上一页 1 ··· 12 13 14 15 16
摘要: 水仙花数 Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 169 Accepted Submission(s) : 37Font: Times New Roman | Verdana | Georgia Font Size: ← →Problem Description春天是鲜花的季节,水仙花就是其中最迷人的代表,数学上有个水仙花数,他是这样定义的:“水仙花数”是指一个三位数,它的各位数字的立方和等于其本身,比如:153=1^3+5^3+3^3 阅读全文
posted @ 2013-07-27 18:51 夏子藤 阅读(250) 评论(0) 推荐(0) 编辑
摘要: 一、#include "stdio.h"int main(){ int a,b; while(scanf("%d %d",&a,&b)!=EOF) { printf("%d\n",a+b); } return 0;}二、#include "stdio.h"int main(){ int a,b,n; scanf("%d",&n); while(n--) { scanf("%d %d",&a,&b); printf("%d\n& 阅读全文
posted @ 2013-07-26 17:59 夏子藤 阅读(381) 评论(0) 推荐(0) 编辑
摘要: #include int main(){ long a,b,s,i,p,t; while(scanf("%ld %ld",&a,&b)!=EOF) { s=0; p=0; if(a>b) {t=a;a=b;b=t;} if(a%2==0) {for(i=a;i<=b;i+=2) s=s+i*i; for(i=a+1;i<=b;i+=2) p=p+i*i*i;} if(a%2==1) {for(i=a;i<=b;i+=2) p=p+i*i*i; for(i=a+1;i<=b;i+=2) s=s+i*i;} printf(" 阅读全文
posted @ 2013-07-26 17:47 夏子藤 阅读(144) 评论(0) 推荐(0) 编辑
摘要: #include int main(){ int a,b,s,i,p; while(scanf("%d %d",&a,&b)!=EOF) { s=0;p=0;if(a%2==0) for(i=a;i<=b;i+=2) s=s+i*i; for(i=a+1;i<=b;i+=2) p=p+i*i*i; if(a%2==1) for(i=a;i<=b;i+=2) p=p+i*i*i; for(i=a+1;i<=b;i+=2) s=s+i*i; printf("%d %d\n",s,p); } return 0;}这个代码 阅读全文
posted @ 2013-07-26 17:45 夏子藤 阅读(175) 评论(0) 推荐(0) 编辑
摘要: #include int main(){ int t; while(scanf("%d",&t)!=EOF) { if(t>=90&&t=80&&t=70&&t=60&&t=0&&t100)这个地方有错误,缺少t<0printf("Score is error!\n"); } return 0;} 阅读全文
posted @ 2013-07-26 17:40 夏子藤 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 成绩转换201307261126-2.txt#include int main(){ int t; while(scanf("%d",&t)!=EOF) { if(t>=90&&t=80&&t=70&&t=60&&t=0&&t100||t<0) printf("Score is error!\n"); } return 0;} 阅读全文
posted @ 2013-07-26 17:32 夏子藤 阅读(1241) 评论(0) 推荐(0) 编辑
上一页 1 ··· 12 13 14 15 16