資源描述:
《杭電acm問題詳解無敵版》由會員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在工程資料-天天文庫。
1、實(shí)用標(biāo)準(zhǔn)文檔選修課考試作業(yè)2012素?cái)?shù)判定332014青年歌手大獎賽_評委會打分342017字符串統(tǒng)計(jì)402019數(shù)列有序!412020絕對值排序432033人見人愛A+B462039三角形482040親和數(shù)49姓名:春杰級:電商14文案大全實(shí)用標(biāo)準(zhǔn)文檔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文案大全實(shí)用標(biāo)準(zhǔn)文檔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);}}文案大全實(shí)用標(biāo)準(zhǔn)文檔1089A+BforInput-OutputPractice(I)ProblemDescriptionYourtaskistoCalculatea+b.Tooeasy?!Ofcourse!Ispeciallydesignedtheproblemforacmbeginners.Youmusthavefoundthatsomeproblemshavethesametitleswiththisone,yes,
4、alltheseproblemsweredesignedforthesameaim.?InputTheinputwillconsistofaseriesofpairsofintegersaandb,separatedbyaspace,onepairofintegersperline.?OutputForeachpairofinputintegersaandbyoushouldoutputthesumofaandbinoneline,andwithonelineofoutputforeachlineininput.?SampleInput151020?Sampl
5、eOutput630?Authorlcy?RecommendJGShining文案大全實(shí)用標(biāo)準(zhǔn)文檔解答:#includemain(){inta,b;while(scanf("%d%d",&a,&b)!=EOF)printf("%d",a+b);}文案大全實(shí)用標(biāo)準(zhǔn)文檔1090A+BforInput-OutputPractice(II)ProblemDescriptionYourtaskistoCalculatea+b.?InputInputcontainsanintegerNinthefirstline,andthenNlinesfollo
6、w.Eachlineconsistsofapairofintegersaandb,separatedbyaspace,onepairofintegersperline.?OutputForeachpairofinputintegersaandbyoushouldoutputthesumofaandbinoneline,andwithonelineofoutputforeachlineininput.?SampleInput2151020?SampleOutput630?Authorlcy?RecommendJGShining文案大全實(shí)用標(biāo)準(zhǔn)文檔解答:#incl
7、ude#defineM1000voidmain(){inta,b,n,j[M],i;//printf("pleaseinputn:");scanf("%d",&n);for(i=0;i8、skistoCalculatea+b.