资源描述:
《浙江大学机试真题.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、2011年浙江大学计算机及软件工程研究生机试真题1001:A+BforMatrices题目描述 Thistime,youaresupposedtofindA+BwhereAandBaretwomatrices,andthencountthenumberofzerorowsandcolumns.输入 Theinputconsistsofseveraltestcases,eachstartswithapairofpositiveintegersMandN(≤10)whicharethenumberofrowsandcolumnsofthematrices,
2、respectively.Then2*Mlinesfollow,eachcontainsNintegersin[-100,100],separatedbyaspace.ThefirstMlinescorrespondtotheelementsofAandthesecondMlinestothatofB. TheinputisterminatedbyazeroMandthatcasemustNOTbeprocessed.输出 Foreachtestcaseyoushouldoutputinonelinethetotalnumberofzerorowsan
3、dcolumnsofA+B.样例输入221111-1-110923123456-1-2-3-4-5-60样例输出152011年浙江大学计算机及软件工程研究生机试真题1002:Grading题目描述 GradinghundredsofthousandsofGraduateEntranceExamsisahardwork.Itisevenhardertodesignaprocesstomaketheresultsasfairaspossible.Onewayistoassigneachexamproblemto3independentexperts.Ifthe
4、ydonotagreetoeachother,ajudgeisinvitedtomakethefinaldecision.Nowyouareaskedtowriteaprogramtohelpthisprocess. Foreachproblem,thereisafull-markPandatoleranceT(
5、atis,if
6、G1-G2
7、≤T,thisproblem'sgradewillbetheaverageofG1andG2. •IfthedifferenceexceedsT,the3rdexpertwillgiveG3. •IfG3iswithinthetolerancewitheitherG1orG2,butNOTboth,thenthisproblem'sgradewillbetheaverageofG3andtheclosestgrade. •IfG3iswithinthetolerancewithbothG1andG2,thenthispr
8、oblem'sgradewillbethemaximumofthethreegrades. •IfG3iswithinthetolerancewithneitherG1norG2,ajudgewillgivethefinalgradeGJ.输入 Eachinputfilemaycontainmorethan onetestcase. Eachcaseoccupiesalinecontainingsixpositiveintegers:P,T,G1,G2,G3,andGJ,asdescribedintheproblem.Itisguaranteedt
9、hatallthegradesarevalid,thatis,intheinterval[0,P].输出 Foreachtestcaseyoushouldoutputthefinalgradeoftheprobleminaline.Theanswermustbeaccurateto1decimalplace.样例输入20215131018样例输出14.02010年浙江大学计算机及软件工程研究生机试真题1003:A+B题目描述给定两个整数A和B,其表示形式是:从个位开始,每三位数用逗号","隔开。现在请计算A+B的结果,并以正常形式输出。输入输入包含多组数据
10、数据,每组数据占一行,由两个整数A和B