欢迎来到天天文库
浏览记录
ID:8235142
大小:116.18 KB
页数:16页
时间:2018-03-11
《the 3rd jilin provincial collegiate programming contest》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、The3rdJiLinProvincialCollegiateProgrammingContestJilinUniversity,2009-5-30No.ProblemTitleBalloonAWelcometoJL2009RedBFractionSubtractionPinkCRoadReconstructionProjectS.RedDCutCornerS.PinkEFindNewHouseGreenFTypewritingOrangeGDividedbyElevenPurpleHBranchPipeWhiteIW-ShapeDataBlueJEnglishWordYellowNot
2、ice:Ifthecontenthasbeenpatched,pleaserefertothewebpage注:如有修改,以网上实时页面为准。rdThe3JiLinProvincialCollegiateProgrammingContestProblemA:WelcometoJL2009Color:RedWelcometothe3rdJiLinProvincialCollegiateProgrammingContest.AlicewantstodrawaposterlikeSeven-SegmentLEDdisplay.Eachcharacterisdisplayedusingaster
3、isksasthesample.Shewantstousedifferentfonttocompleteherwork,thatis,eachletterholdsn+2columnsand2*n+3rows.ThereisjustonecolumnofblanksbetweentwoadjacentlettersInput:Theinputfilehasseveraltestcases.Thefirstlineofeachtestcasecontainsanintegern(04、andthestringiswhatyoushouldoutputusethegivenfontsize.Thecharactersofthestringshouldonlyuse'J','L','2','0'and'9'.Thelengthofthestringisnomorethan10.Output:Foreachinputcase,outputthestringbythegivenfont.Don'toutputuselessblanklinesoruselessspaceaftereachline,otherwiseyouwillgeta"PresentationError".5、Betweentwocases,outputablankline.SampleInput2JL2009SampleOutputPage1of15rdThe3JiLinProvincialCollegiateProgrammingContestProblemB:FractionSubtractionColor:PinkCalculatingthedifferenceoftwofractions,andtheresultisalsoexpressedinfractioninlowestterms.Afractioninwhichthenumeratoranddenominatorhaveno6、factorsincommon(otherthan1)issaidtobeinitslowestorsimplestterms.Outputthenumeratoronlywhentheresultisinteger.InputEachlinehasfourpositiveintegerswhichareabcd,respectively.Allofthemarelessthan40000.OutputForeachcase,calculatethevalueofa/b-c/d,andprintitinoneline.Theoutputformatsareasfollows:Ifther7、esultisinteger,printitonaline.Otherwise,printtheresultinthreelines.Thefirstlineisthenumerator,thesecondisseveralsignsof'='expressingthevinculum(fractionbar),andthethirdlineisdenominator.Thewidthoftheoutputshouldbeequal
4、andthestringiswhatyoushouldoutputusethegivenfontsize.Thecharactersofthestringshouldonlyuse'J','L','2','0'and'9'.Thelengthofthestringisnomorethan10.Output:Foreachinputcase,outputthestringbythegivenfont.Don'toutputuselessblanklinesoruselessspaceaftereachline,otherwiseyouwillgeta"PresentationError".
5、Betweentwocases,outputablankline.SampleInput2JL2009SampleOutputPage1of15rdThe3JiLinProvincialCollegiateProgrammingContestProblemB:FractionSubtractionColor:PinkCalculatingthedifferenceoftwofractions,andtheresultisalsoexpressedinfractioninlowestterms.Afractioninwhichthenumeratoranddenominatorhaveno
6、factorsincommon(otherthan1)issaidtobeinitslowestorsimplestterms.Outputthenumeratoronlywhentheresultisinteger.InputEachlinehasfourpositiveintegerswhichareabcd,respectively.Allofthemarelessthan40000.OutputForeachcase,calculatethevalueofa/b-c/d,andprintitinoneline.Theoutputformatsareasfollows:Ifther
7、esultisinteger,printitonaline.Otherwise,printtheresultinthreelines.Thefirstlineisthenumerator,thesecondisseveralsignsof'='expressingthevinculum(fractionbar),andthethirdlineisdenominator.Thewidthoftheoutputshouldbeequal
此文档下载收益归作者所有