
杭电题目acm答案.doc
54页选修课考试作业1001 Sum Problem.............................................................................................................................21089 A+B for Input-Output Practice (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)..................................................................................142000 ASCII 码排序 .........................................................................................................................162001 计算两点间的距离 .................................................................................................................172002 计算球体积 .............................................................................................................................192003 求绝对值 .................................................................................................................................202004 成绩转换 .................................................................................................................................212005 第几天? .................................................................................................................................222006 求奇数的乘积 .........................................................................................................................242007 平方和与立方和 .....................................................................................................................262008 数值统计 .................................................................................................................................272009 求数列的和 .............................................................................................................................282010 水仙花数 .................................................................................................................................292011 多项式求和 .............................................................................................................................312012 素数判定 .................................................................................................................................332014 青年歌手大奖赛_评委会打分 ...............................................................................................342015 偶数求和 .................................................................................................................................362016 数据的交换输出 .....................................................................................................................382017 字符串统计 .............................................................................................................................402019 数列有序! ...............................................................................................................................412020 绝对值排序 .............................................................................................................................432021 发工资咯:) .........................................................................................................................452033 人见人爱 A+B........................................................................................................................462039 三角形 .....................................................................................................................................482040 亲和数 .....................................................................................................................................49姓名:郑春杰班级:电商 1001学号:10105041341001 Sum ProblemProblem DescriptionHey, welcome to HDOJ(Hangzhou Dianzi University Online Judge).In this problem, your task is to calculate SUM(n) = 1 + 2 + 3 + ... + n.InputThe input will consist of a series of integers n, one integer per line.OutputFor each case, output SUM(n) in one line, followed by a blank line. You may assume the result will be in the range of 32-bit signed integer.Sample Input1100Sample Output15050AuthorDOOM III解答:#includemain(){int n,i,sum;sum=0;while((scanf("%d",&n)!=-1)){sum=0;for(i=0;imain(){int a,b;while(scanf("%d%d",&a,&b)!=EOF)printf("%d\n",a+b);}1090 A+B for Input。