上一页 1 ··· 38 39 40 41 42
摘要: View Code 1 #include<stdio.h> 2 int a[105]; 3 int main() 4 { 5 int t,i,j,n,max,thismax;//,num=0;//p1,p2; 6 scanf("%d",&t); 7 while(t--) 8 { 9 scanf("%d",&n);10 //num++;11 //p1=1;p2=1;12 for(i=0;i<n;i++)13 scanf("%d",&a[i]);14 max=a... 阅读全文
posted @ 2012-04-27 16:16 xxx0624 阅读(219) 评论(0) 推荐(0) 编辑
摘要: View Code #include<stdio.h>int main(){ int n,m,k,t,left; scanf("%d",&t); while(t--) { scanf("%d%d",&n,&m); k=m+1; left=n%k; if(left>0) printf("first\n"); else if(left==0) printf("second\n"); } return 0;}知道一点就好:... 阅读全文
posted @ 2012-04-27 00:19 xxx0624 阅读(148) 评论(0) 推荐(0) 编辑
摘要: View Code 1 #include<stdio.h> 2 int wi[3420]={0},di[3420]={0},val[40000]={0};//di表示价值也就是各个物体的重量.val为目标。 3 int fmax(int i,int j) 4 { 5 if(i>j)return i; 6 else return j; 7 8 } 9 int main()10 {11 int max,n,i,j;12 scanf("%d%d",&n,&max);13 getchar();14 for(i=1;i<=n;i++)15 .. 阅读全文
posted @ 2012-04-26 23:51 xxx0624 阅读(189) 评论(0) 推荐(0) 编辑
摘要: 1 #include<stdio.h> 2 #include<string.h> 3 const int dx[]={0,0,1,-1,-1,-1,1,1}; 4 const int dy[]={1,-1,0,0,-1,1,-1,1};//走的方向 5 char map[1005][100]; 6 int dfs(int x,int y) 7 { 8 int i,j,k,tp,ddx,ddy; 9 if(map[x][y]=='.')10 return 0;//11 map[x][y]='.';//表示遍历过了12 tp=1;13 fo. 阅读全文
posted @ 2012-04-26 23:23 xxx0624 阅读(236) 评论(0) 推荐(0) 编辑
摘要: View Code 1 #include<stdio.h> 2 #include<string.h> 3 const int dx[]={0,0,1,-1}; 4 const int dy[]={1,-1,0,0};//走的方向 5 char map[1005][100]; 6 int max,hang,lie; 7 int fmax(int p,int q) 8 { 9 if(p>q)10 return p;11 else12 return q;13 }14 int dfs(int i,int j)15 {16 int ddx,ddy,k,tp;17 map[i 阅读全文
posted @ 2012-04-26 23:03 xxx0624 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 1 #include<stdio.h> 2 #include<stdlib.h> 3 struct gg 4 { 5 int j; 6 int f; 7 double p; 8 }gl[1005],tp; 9 int cmp(const void *a,const void *b)10 {11 return (*(struct gg*)b).p>(*(struct gg*)a).p?1:-1;12 }13 int main()14 {15 int m,n,i;16 double left,sum;17 while(scanf("%d%d... 阅读全文
posted @ 2012-04-26 23:00 xxx0624 阅读(473) 评论(0) 推荐(0) 编辑
上一页 1 ··· 38 39 40 41 42