上一页 1 ··· 4 5 6 7 8 9 10 11 下一页
  2011年7月16日
摘要: #include<stdio.h>#include<string.h>#include<stdlib.h>int cmp(const void *a,const void *b){ return *(int *)a-*(int *)b;}int main(){ int s[110]; int n; double ave,sum; while(scanf("%d",&n)!=EOF) { sum=0.00; ave=0.00; memset(s,0,sizeof(s[0])); for(int i=0;i<n;i++) { s 阅读全文
posted @ 2011-07-16 15:01 枫叶飘泪 阅读(266) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h>#include<string.h>#include<stdlib.h>int main(){ int n; while(scanf("%d",&n)!=EOF) { int s=1; for(int i=2;i<=n;i++) { s=(s+1)*2; } printf("%d\n",s); } //system("pause"); return 0;}编辑器加载中... 阅读全文
posted @ 2011-07-16 14:52 枫叶飘泪 阅读(265) 评论(0) 推荐(0) 编辑
摘要: 编辑器加载#include<stdio.h>#include<string.h>#include<stdlib.h>#include<math.h>int sushu(int a){ int c=0; if(a==0||a==1) { return 1; } else { for(int i=2;i<=sqrt(a);i++) { if(a%i==0) { c++; break; } } if(c==1) return 0; else return 1; }} int main(){ int x,y; while(scanf("% 阅读全文
posted @ 2011-07-16 14:46 枫叶飘泪 阅读(321) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h>#include<string.h>#include<stdlib.h>int main(){ int n,m; double sum; while(scanf("%d",&m)!=EOF) { while(m--) { sum=0; scanf("%d",&n); for(int i=1;i<=n;i++) { if(i%2==0) sum-=(1.00/i);//注意要转换为double型 else sum+=(1.00/i); } printf(" 阅读全文
posted @ 2011-07-16 14:31 枫叶飘泪 阅读(285) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h>#include<string.h>#include<stdlib.h>int main(){ int m,n; while(scanf("%d%d",&m,&n)!=EOF) { int c=0,t; for(int i=m;i<=n;i++) { t=(i/100)*(i/100)*(i/100)+((i/10)%10)*((i/10)%10)*((i/10)%10)+(i%100%10)*(i%100%10)*(i%100%10); if(t==i) { c++; if(c== 阅读全文
posted @ 2011-07-16 10:42 枫叶飘泪 阅读(292) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h>#include<string.h>#include<stdlib.h>#include<math.h>int main(){ int n,m; while(scanf("%d%d",&n,&m)!=EOF) { double sum,t=n; for(int i=1;i<=m;i++) { if(i==1) sum=n; else { t=sqrt(t); sum+=t; } } printf("%.2lf\n",sum); } //system(& 阅读全文
posted @ 2011-07-16 09:08 枫叶飘泪 阅读(344) 评论(0) 推荐(0) 编辑
  2011年7月15日
摘要: #include<stdio.h>#include<string.h>#include<stdlib.h>int main(){ int a,b,c,n; double m; while(scanf("%d",&n),n) { a=b=c=0; for(int i=1;i<=n;i++) { scanf("%lf",&m); if(m<0.00) { a++; } else { if(m==0.00) b++; else c++; } } printf("%d %d %d\n&qu 阅读全文
posted @ 2011-07-15 21:47 枫叶飘泪 阅读(303) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h>#include<string.h>#include<stdlib.h>int main(){ int m,n,x,y; while(scanf("%d%d",&m,&n)!=EOF) { x=0; y=0; if(m>n)//比较m与n的大小又没注意,太粗心了,题目中没给的条件不要想当然。 { m=m+n; n=m-n; m=m-n; } for(int i=m;i<=n;i++) { if(i%2==0) { x+=i*i; } else { y+=i*i*i; } } p 阅读全文
posted @ 2011-07-15 21:38 枫叶飘泪 阅读(376) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h>#include<string.h>#include<stdlib.h>int main(){ int n,sum,a; while(scanf("%d",&n)!=EOF) { sum=1; for(int i=1;i<=n;i++) { scanf("%d",&a); if(a%2!=0) { sum*=a; } } printf("%d\n",sum); } // system("pause"); return 0;} 阅读全文
posted @ 2011-07-15 21:22 枫叶飘泪 阅读(237) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h>#include<string.h>#include<stdlib.h>int main(){ int y,m,d,run,sum; while(scanf("%d/%d/%d",&y,&m,&d)!=EOF) { run=0; sum=0; if(y%400==0||y%4==0&&y%100!=0)//闰年是能被400整除或者是能被4但是不能被100整除的年份 { run=1; } for(int i=1;i<m;i++) { switch(i) { ca 阅读全文
posted @ 2011-07-15 21:18 枫叶飘泪 阅读(376) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 下一页