上一页 1 ··· 78 79 80 81 82 83 84 85 86 ··· 99 下一页

2011年4月28日

发工资咯:

摘要: #include<stdio.h>int num=0;void fun(int x){ num+=x/100; x=x%100; num+=x/50; x=x%50; num+=x/10; x=x%10; num+=x/5; x=x%5; num+=x/2; x=x%2; num+=x/1;}int main( ){ int N,i,t; while(scanf("%d",&N)!=EOF,N) { for(i=1;i<=N;i++) { scanf("%d",&t); fun(t); } printf("%d 阅读全文

posted @ 2011-04-28 17:25 more think, more gains 阅读(157) 评论(0) 推荐(0) 编辑

绝对值排序

摘要: #include<stdio.h>#include<stdlib.h>#include<string.h>#include<math.h>int cmp(const void *a,const void *b){ return abs(*(int *)a)< abs(*(int *)b)?1:-1;}int main( ){ int N,A[10000]; while(scanf("%d",&N)... 阅读全文

posted @ 2011-04-28 16:58 more think, more gains 阅读(180) 评论(0) 推荐(0) 编辑

数列有序!

摘要: #include<stdio.h>int A[10000];int main( ){ int N,M,i,j,k; while(scanf("%d%d",&N,&M),N||M) { for(i=0;i<N;i++) scanf("%d",&A[i]); for(i=0;i<N;i++) if(M<=A[i]) { for(j=N-1;j>=i;j--) A[j+1]=A[j]; A[i]=M; ... 阅读全文

posted @ 2011-04-28 16:36 more think, more gains 阅读(127) 评论(0) 推荐(0) 编辑

母牛的故事

摘要: #include<stdio.h>int fun(int x){ if(x==1) return 1; else if(x==2) return 2; else if(x==3) return 3; else return fun(x-1)+fun(x-3);}int main( ){ int N; while(scanf("%d",&N)!=EOF,N) printf("%d\n",fun(N)); return 0;} 阅读全文

posted @ 2011-04-28 16:17 more think, more gains 阅读(151) 评论(0) 推荐(0) 编辑

字符串统计

摘要: #include<stdio.h>#include<string.h>int main( ){ int N; char ch[200]; scanf("%d",&N); while(N--) { int n=0,i; scanf("%s",ch); for(i=0;ch[i]!='\0';i++) if(ch[i]>='0'&&ch[i]<='9') n++; printf("%d\n",n);}return 0;} 阅读全文

posted @ 2011-04-28 16:12 more think, more gains 阅读(126) 评论(0) 推荐(0) 编辑

上一页 1 ··· 78 79 80 81 82 83 84 85 86 ··· 99 下一页

导航