杭电题目acm问题详解.doc

杭电题目acm问题详解.doc

ID:55915769

大小:211.50 KB

页数:52页

时间:2020-06-14

杭电题目acm问题详解.doc_第1页
杭电题目acm问题详解.doc_第2页
杭电题目acm问题详解.doc_第3页
杭电题目acm问题详解.doc_第4页
杭电题目acm问题详解.doc_第5页
资源描述:

《杭电题目acm问题详解.doc》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库

1、1001SumProblem21089A+BforInput-OutputPractice(I)41090A+BforInput-OutputPractice(II)61091A+BforInput-OutputPractice(III)81092A+BforInput-OutputPractice(IV)91093A+BforInput-OutputPractice(V)111094A+BforInput-OutputPractice(VI)121095A+BforInput-OutputPractice(VII

2、)131096A+BforInput-OutputPractice(VIII)142000ASCII码排序162001计算两点间的距离172002计算球体积192003求绝对值202004成绩转换212005第几天?222006求奇数的乘积242007平方和与立方和262008数值统计272009求数列的和282010水仙花数292011多项式求和312012素数判定332014青年歌手大奖赛_评委会打分342015偶数求和362016数据的交换输出382017字符串统计402019数列有序!412020绝对值排序

3、432021发工资咯:)452033人见人爱A+B462039三角形482040亲和数49:春杰班级:电商1001学号:10105041341001SumProblemProblemDescriptionHey,welcometoHDOJ(HangzhouDianziUniversityOnlineJudge).Inthisproblem,yourtaskistocalculateSUM(n)=1+2+3+...+n. InputTheinputwillconsistofaseriesofintegersn,one

4、integerperline. OutputForeachcase,outputSUM(n)inoneline,followedbyablankline.Youmayassumetheresultwillbeintherangeof32-bitsignedinteger. SampleInput1100 SampleOutput15050 AuthorDOOMIII解答:#includemain(){intn,i,sum;sum=0;while((scanf("%d",&n)!=-1)){sum=

5、0;for(i=0;i<=n;i++)sum+=i;printf("%d",sum);}}1089A+BforInput-OutputPractice(I)ProblemDescriptionYourtaskistoCalculatea+b.Tooeasy?!Ofcourse!Ispeciallydesignedtheproblemforacmbeginners.Youmusthavefoundthatsomeproblemshavethesametitleswiththisone,yes,allthese

6、problemsweredesignedforthesameaim. InputTheinputwillconsistofaseriesofpairsofintegersaandb,separatedbyaspace,onepairofintegersperline. OutputForeachpairofinputintegersaandbyoushouldoutputthesumofaandbinoneline,andwithonelineofoutputforeachlineininput. SampleIn

7、put151020 SampleOutput630 Authorlcy RecommendJGShining解答:#includemain(){inta,b;while(scanf("%d%d",&a,&b)!=EOF)printf("%d",a+b);}1090A+BforInput-OutputPractice(II)ProblemDescriptionYourtaskistoCalculatea+b. InputInputcontainsanintegerNinthefirstline,

8、andthenNlinesfollow.Eachlineconsistsofapairofintegersaandb,separatedbyaspace,onepairofintegersperline. OutputForeachpairofinputintegersaandbyoushouldoutputthesumofaandbinoneline,an

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。