资源描述:
《杭电acm问题详解无敌版》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、实用标准文档选修课考试作业2012素数判定332014青年歌手大奖赛_评委会打分342017字符串统计402019数列有序!412020绝对值排序432033人见人爱A+B462039三角形482040亲和数49姓名:春杰级:电商14文案大全实用标准文档1001SumProblemProblemDescriptionHey,welcometoHDOJ(HangzhouDianziUniversityOnlineJudge).Inthisproblem,yourtaskistocalculateSUM(n)=1+2+3+...+n. InputTheinputw
2、illconsistofaseriesofintegersn,oneintegerperline. OutputForeachcase,outputSUM(n)inoneline,followedbyablankline.Youmayassumetheresultwillbeintherangeof32-bitsignedinteger. SampleInput1100 SampleOutput15050 AuthorDOOMIII解答:#include文案大全实用标准文档main(){intn,i,sum;sum=0;while((scan
3、f("%d",&n)!=-1)){sum=0;for(i=0;i<=n;i++)sum+=i;printf("%d",sum);}}文案大全实用标准文档1089A+BforInput-OutputPractice(I)ProblemDescriptionYourtaskistoCalculatea+b.Tooeasy?!Ofcourse!Ispeciallydesignedtheproblemforacmbeginners.Youmusthavefoundthatsomeproblemshavethesametitleswiththisone,yes,
4、alltheseproblemsweredesignedforthesameaim. InputTheinputwillconsistofaseriesofpairsofintegersaandb,separatedbyaspace,onepairofintegersperline. OutputForeachpairofinputintegersaandbyoushouldoutputthesumofaandbinoneline,andwithonelineofoutputforeachlineininput. SampleInput151020 Sampl
5、eOutput630 Authorlcy RecommendJGShining文案大全实用标准文档解答:#includemain(){inta,b;while(scanf("%d%d",&a,&b)!=EOF)printf("%d",a+b);}文案大全实用标准文档1090A+BforInput-OutputPractice(II)ProblemDescriptionYourtaskistoCalculatea+b. InputInputcontainsanintegerNinthefirstline,andthenNlinesfollo
6、w.Eachlineconsistsofapairofintegersaandb,separatedbyaspace,onepairofintegersperline. OutputForeachpairofinputintegersaandbyoushouldoutputthesumofaandbinoneline,andwithonelineofoutputforeachlineininput. SampleInput2151020 SampleOutput630 Authorlcy RecommendJGShining文案大全实用标准文档解答:#incl
7、ude#defineM1000voidmain(){inta,b,n,j[M],i;//printf("pleaseinputn:");scanf("%d",&n);for(i=0;i8、skistoCalculatea+b.