杭电ACM水题题目及代码

上传人:平*** 文档编号:18085655 上传时间:2017-11-13 格式:DOCX 页数:75 大小:119.17KB
返回 下载 相关 举报
杭电ACM水题题目及代码_第1页
第1页 / 共75页
杭电ACM水题题目及代码_第2页
第2页 / 共75页
杭电ACM水题题目及代码_第3页
第3页 / 共75页
杭电ACM水题题目及代码_第4页
第4页 / 共75页
杭电ACM水题题目及代码_第5页
第5页 / 共75页
点击查看更多>>
资源描述

《杭电ACM水题题目及代码》由会员分享,可在线阅读,更多相关《杭电ACM水题题目及代码(75页珍藏版)》请在金锄头文库上搜索。

1、1002 A + B Problem IITime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 69615 Accepted Submission(s): 12678Problem DescriptionI have a very simple problem for you. Given two integers A and B, your job is to calculate the Sum of A + B.InputThe first l

2、ine of the input contains an integer T(1#include int main()char str11001, str21001;int t, i, len_str1, len_str2, len_max, num = 1, k;scanf(%d, &t);getchar();while(t-)int a1001 = 0, b1001 = 0, c1001 = 0;scanf(%s, str1);len_str1 = strlen(str1);for(i = 0; i len_str2)len_max = len_str1;elselen_max = len

3、_str2;k = 0;for(i = 0; i = 0; -i)printf(%d, ci);printf(n);if(t = 1)printf(n);return 0;成绩转换Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 25250 Accepted Submission(s): 10776Problem Description输入一个百分制的成绩 t,将其转换成对应的等级,具体转换规则如下:90100 为 A;8089 为 B;707

4、9 为 C;6069 为 D;059 为 E;Input输入数据有多组,每组占一行,由一个整数组成。Output对于每组输入数据,输出一行。如果输入数据不在 0100 范围内,请输出一行:“Score is error!”。Sample Input5667100123Sample OutputEDAScore is error!AuthorlcySourceC 语言程序设计练习(一) RecommendJGShining#include int main()int n, k;while(scanf(%d, &n) != EOF)if(n 100)printf(Score is error!n)

5、;elsek = n / 10;switch(k)case 10: printf(An); break;case 9: printf(An); break;case 8: printf(Bn); break;case 7: printf(Cn); break;case 6: printf(Dn); break;default: printf(En); break;return 0;2007 平方和与立方和Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s

6、) : 65 Accepted Submission(s) : 9Font: Times New Roman | Verdana | GeorgiaFont Size: Problem Description给定一段连续的整数,求出他们中所有偶数的平方和以及所有奇数的立方和。Input输入数据包含多组测试实例,每组测试实例包含一行,由两个整数 m 和 n 组成。Output对于每组输入数据,输出一行,应包括两个整数 x 和 y,分别表示该段连续的整数中所有偶数的平方和以及所有奇数的立方和。你可以认为 32 位整数足以保存结果。Sample Input1 32 5Sample Output4 2

7、820 152AuthorlcySourceC 语言程序设计练习(一)Statistic | #include int main()int x , y, temp, sum1, sum2;while(scanf(%d %d, &x, &y) != EOF)sum1 = 0;sum2 = 0;if(x y)temp = x;x = y;y = temp;for(; x int main() int m, n, k1, k2, k3, count;while(scanf(%d %d, &m, &n) != EOF)for(count = 0; m int main()int x, y, sum,

8、i, count, n;while(scanf(%d %d, &x, &y) != EOF & (x!=0 | y!= 0)count = 0;for(n = x; n long pantao (int n)return n = 1 ? 1 : 2 + 2 * pantao(n-1);int main()int n;while(scanf(%d, &n) != EOF)printf(%dn, pantao(n);return 0;2014 青年歌手大奖赛_评委会打分Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768

9、K (Java/Others)Total Submission(s): 17419 Accepted Submission(s): 7801Problem Description青年歌手大奖赛中,评委会给参赛选手打分。选手得分规则为去掉一个最高分和一个最低分,然后计算平均得分,请编程输出某选手的得分。Input输入数据有多组,每组占一行,每行的第一个数是 n(2int main ()int n,i;double sum, averge, max, min, score;while(scanf(%d,&n)!=EOF)scanf(%lf,&score);max = score;min = sco

10、re;sum = score;for(i=2;imax) max=score;if(scoreint main()int n, i, k, a100,min, temp; while(scanf(%d, &n) != EOF & n != 0) scanf(%d, &a0);min = a0;k = 0;for(i = 1; i int main()int num, n, i;char line;scanf(%d, &n);getchar();for(i = 1; i =0 & line int main()int n, i, j,frag;char line50;while(scanf(%d

11、, &n) != EOF)getchar(); for(i = 1; i =0&linej=A&linej=a&linej= 0 & line0 int main()int i, max, n, j, line100;while(line0=getchar() != EOF)max = line0;i = 1;for(; (linei = getchar() != n; +i)if(linei max) max = linei;n = i;for(j = 0; j #include int main () int n, i;char a11;scanf(%d, &n);getchar();wh

12、ile(n-)for(i = 0; i int main()int T, n, m, i;scanf(%d, &T);for (i = 1; i void main()int s,t,i;double vul,d,sum; while(scanf(%lf%lf,&vul,&d)!=EOF)s=vul/d;if(vuls*d) s+;sum=0;t=0;for(i=1;i+)sum+=i*d;if(sum=vul)break;else t+;s+=t;printf(%dn,s);选修课考试作业1001 Sum Problem.21089 A+B for Input-Output Practice

13、 (I) .41090 A+B for Input-Output Practice (II).61091 A+B for Input-Output Practice (III).81092 A+B for Input-Output Practice (IV) .91093 A+B for Input-Output Practice (V).111094 A+B for Input-Output Practice (VI) .121095 A+B for Input-Output Practice (VII).131096 A+B for Input-Output Practice (VIII).

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 中学教育 > 试题/考题

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号