整理出acm所有題目附標(biāo)準(zhǔn)答案

整理出acm所有題目附標(biāo)準(zhǔn)答案

ID:34771180

大?。?018.00 KB

頁數(shù):212頁

時間:2019-03-10

整理出acm所有題目附標(biāo)準(zhǔn)答案_第1頁
整理出acm所有題目附標(biāo)準(zhǔn)答案_第2頁
整理出acm所有題目附標(biāo)準(zhǔn)答案_第3頁
整理出acm所有題目附標(biāo)準(zhǔn)答案_第4頁
整理出acm所有題目附標(biāo)準(zhǔn)答案_第5頁
資源描述:

《整理出acm所有題目附標(biāo)準(zhǔn)答案》由會員上傳分享,免費在線閱讀,更多相關(guān)內(nèi)容在行業(yè)資料-天天文庫。

1、1000A+BProblemProblemDescriptionCalculateA+B.InputEachlinewillcontaintwointegersAandB.Processtoendoffile.?矚慫潤厲釤瘞睞櫪廡賴。OutputForeachcase,outputA+Binoneline.?SampleInput11?SampleOutput2?AuthorHDOJ代碼:#includeintmain(){inta,b;while(scanf("%d%d",&a,&b)!=EOF)printf("%d",a+b);}1001SumProblem

2、ProblemDescriptionHey,welcometoHDOJ(HangzhouDianziUniversityOnlineJudge).Inthisproblem,yourtaskistocalculateSUM(n)=1+2+3+...+n.聞創(chuàng)溝燴鐺險愛氌譴凈。?212/212InputTheinputwillconsistofaseriesofintegersn,oneintegerperline.殘騖樓諍錈瀨濟(jì)溆塹籟。?OutputForeachcase,outputSUM(n)inoneline,followedbyablankline.Youmayassumet

3、heresultwillbeintherangeof32-bitsignedinteger.?釅錒極額閉鎮(zhèn)檜豬訣錐。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",sum);}}212/2121002A+BProblemIIProblemDescriptionIhaveaverysimpleproblemf

4、oryou.GiventwointegersAandB,yourjobistocalculatetheSumofA+B.彈貿(mào)攝爾霽斃攬磚鹵廡。?InputThefirstlineoftheinputcontainsanintegerT(1<=T<=20)whichmeansthenumberoftestcases.ThenTlinesfollow,eachlineconsistsoftwopositiveintegers,AandB.Noticethattheintegersareverylarge,thatmeansyoushouldnotprocessthembyusing32-

5、bitinteger.Youmayassumethelengthofeachintegerwillnotexceed1000.?謀蕎摶篋飆鐸懟類蔣薔。OutputForeachtestcase,youshouldoutputtwolines.Thefirstlineis"Case#:",#meansthenumberofthetestcase.Thesecondlineistheanequation"A+B=Sum",SummeanstheresultofA+B.Notetherearesomespacesinttheequation.Outputablanklinebetweent

6、wotestcases.廈礴懇蹣駢時盡繼價騷。?SampleInput212112233445566778899998877665544332211?SampleOutputCase1:1+2=3Case2:112233445566778899+998877665544332211=1111111111111111110?煢楨廣鰳鯡選塊網(wǎng)羈淚。AuthorIgnatius.L?代碼:#include#includeintmain(){charstr1[1001],str2[1001];intt,i,len_str1,len_str2,len_ma

7、x,num=1,k;scanf("%d",&t);212/212getchar();while(t--){inta[1001]={0},b[1001]={0},c[1001]={0};scanf("%s",str1);len_str1=strlen(str1);for(i=0;i<=len_str1-1;++i)a[i]=str1[len_str1-1-i]-'0';scanf("%s",str2);len_str2=strlen(str2);for(i=

當(dāng)前文檔最多預(yù)覽五頁,下載文檔查看全文

此文檔下載收益歸作者所有

當(dāng)前文檔最多預(yù)覽五頁,下載文檔查看全文
溫馨提示:
1. 部分包含數(shù)學(xué)公式或PPT動畫的文件,查看預(yù)覽時可能會顯示錯亂或異常,文件下載后無此問題,請放心下載。
2. 本文檔由用戶上傳,版權(quán)歸屬用戶,天天文庫負(fù)責(zé)整理代發(fā)布。如果您對本文檔版權(quán)有爭議請及時聯(lián)系客服。
3. 下載前請仔細(xì)閱讀文檔內(nèi)容,確認(rèn)文檔內(nèi)容符合您的需求后進(jìn)行下載,若出現(xiàn)內(nèi)容與標(biāo)題不符可向本站投訴處理。
4. 下載文檔時可能由于網(wǎng)絡(luò)波動等原因無法下載或下載錯誤,付費完成后未能成功下載的用戶請聯(lián)系客服處理。