资源描述:
《部分ACM题目与问题详解》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
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)131096
2、A+BforInput-OutputPractice(VIII)142000ASCII码排序162001计算两点间的距离172002计算球体积192003求绝对值202004成绩转换212005第几天?222006求奇数的乘积242007平方和与立方和262008数值统计272009求数列的和282010水仙花数292011多项式求和312012素数判定332014青年歌手大奖赛_评委会打分342015偶数求和362016数据的交换输出382017字符串统计40文档大全标准实用2019数列有序!412020绝对值排序432021发工资咯
3、:)452033人见人爱A+B462039三角形482040亲和数49文档大全标准实用1001SumProblemProblemDescriptionHey,welcometoHDOJ(HangzhouDianziUniversityOnlineJudge).Inthisproblem,yourtaskistocalculateSUM(n)=1+2+3+...+n. InputTheinputwillconsistofaseriesofintegersn,oneintegerperline. OutputForeachcase,outp
4、utSUM(n)inoneline,followedbyablankline.Youmayassumetheresultwillbeintherangeof32-bitsignedinteger. SampleInput1100 文档大全标准实用SampleOutput15050 AuthorDOOMIII解答:#includemain(){intn,i,sum;sum=0;while((scanf("%d",&n)!=-1)){sum=0;for(i=0;i<=n;i++)sum+=i;printf("%d"
5、,sum);}}文档大全标准实用文档大全标准实用1089A+BforInput-OutputPractice(I)ProblemDescriptionYourtaskistoCalculatea+b.Tooeasy?!Ofcourse!Ispeciallydesignedtheproblemforacmbeginners.Youmusthavefoundthatsomeproblemshavethesametitleswiththisone,yes,alltheseproblemsweredesignedforthesameaim. I
6、nputTheinputwillconsistofaseriesofpairsofintegersaandb,separatedbyaspace,onepairofintegersperline. OutputForeachpairofinputintegersaandbyoushouldoutputthesumofaandbinoneline,andwithonelineofoutputforeachlineininput. SampleInput151020 SampleOutput6文档大全标准实用30 Authorlcy Rec
7、ommendJGShining解答:#includemain(){inta,b;while(scanf("%d%d",&a,&b)!=EOF)printf("%d",a+b);}文档大全标准实用1090A+BforInput-OutputPractice(II)ProblemDescriptionYourtaskistoCalculatea+b. InputInputcontainsanintegerNinthefirstline,andthenNlinesfollow.Eachlineconsistsofapai
8、rofintegersaandb,separatedbyaspace,onepairofintegersperline. OutputForeachpairofinputintegersaandbyoush