- 博客(12)
- 资源 (9)
- 收藏
- 关注
原创 barn repair
#include using namespace std; int main() { int i,j,k,m,s,c,start=1,minlength=0; int number[201],sort[200]; ifstream fin ("barn1.in"); ofstream fout ("barn1.out"); fin>>m>>s>>c; for(i=1;i<=c;i++)
2012-06-26 22:23:33 302
原创 milk
#include using namespace std; int main() { int n,m,i,j,k,q; ifstream fin ("milk.in"); ofstream fout ("milk.out"); fin>>n>>m;//n:所需牛奶,m:农民个数 int p[5001],a[5001];//p保存单价,a保存每个农民能买的总量 for(i=1;i<=m;
2012-06-25 22:53:01 890
原创 dual palindromes
#include #include #include #include using namespace std; int main() { char a[]={'0','1','2','3','4','5','6','7','8','9'}; ifstream fin ("dualpal.in"); ofstream fout ("dualpal.out"); int n,s,i,j;
2012-06-25 19:42:50 262
原创 palindromic squares
/* PROG:palsquare LANG:C++ */ #include #include #include #include using namespace std; int main() { ifstream fin ("palsquare.in"); ofstream fout ("palsquare.out"); int i,j,k,m; int ary;//进制 fin>>
2012-06-25 18:35:42 302
原创 name that number
/* ID:wsbqw1 PROG:namenum LANG:C++ */ #include #include #include using namespace std; int main() { int i,j=0; string s; ifstream fin ("dict.txt"); ofstream fout ("namenum.out"); ifstream fin1 ("n
2012-06-24 20:08:17 230
原创 beads
#include #include #include #define null NULL using namespace std; typedef struct stack { struct stack *prior; struct stack *next; char c; }stack; int main() { ifstream fin ("beads.in"); ofstre
2012-06-22 20:04:59 226
原创 Greedy Gift Givers
/* ID:wsbqw1 PROG:gift1 LANG:C++ */ #include #include #include #include using namespace std; int main() { ifstream fin ("gift1.in"); ofstream fout ("gift1.out"); string s[15]; int m[15]={0}; int
2012-06-21 10:37:25 392
原创 your ride is here
#include #include #include using namespace std; int main() { ofstream fout ("ride.out"); ifstream fin ("ride.in"); string a,b; int i,j,k,l,s1=1,s2=1,w1,w2; while(fin>>a>>b) { i=a.length(); j
2012-06-20 16:46:55 239
原创 朴素字符串匹配
//朴素字符串匹配 #include #include using namespace std; void stringmatch(string t,string s) { int m=t.length(); int n=s.length(); int i,j; for(i=0;i<=m-n;i++) { for(j=0;j<n;j++) { if(t[j+i]!=s[j]
2012-06-19 20:37:58 212
原创 二叉查找树的创建,插入,搜索,查询后继
#include #include #define null NULL typedef struct t { int key; struct t *left; struct t *right; struct t *parent; }tree; tree* insert(tree *t,int i) { tree *p=null; tree *x=t; if(t==null) {
2012-06-04 18:31:58 252
原创 快速查找数组中第几小的元素
#include int patition(int a[],int p,int r) { int x=a[r]; int i=p-1; int j; for(j=p;j<=r-1;j++) { if(a[j]<=x) { i++; int temp=a[j]; a[j]=a[i]; a[i]=temp; } } int tem; tem=a[i+
2012-06-02 21:08:42 481
原创 快排2
#include int patition(int a[],int p,int r) { int i=p-1; int x=a[r]; for(int j=p;j<=r-1;j++) { if(a[j]<=x) { i++; int temp; temp=a[j]; a[j]=a[i]; a[i]=temp; } } int tem;
2012-06-02 16:53:07 406
Node.js Design Patterns nodejs设计模式第2版
2018-11-07
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人