资源描述:
《华为软件笔试题》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、华为软件笔试题CalculatethenumberofmahjongMah-jongggamesarebecomingmoredndmorepopularandpopularonline・Thistopicisasetofmah-jonggthathasbeenplayedandwrittentocalculatethenumberofmahjongtiles・Tosimplifythetopic,assumingmahjongbobbinandsliveronlytwokindsofpattern,candoubleandonlythefollowingthreerules,whe
2、nagroupofcardwithoutoneormoreofthefollowingthreekindsofcircumstance,thenthissetto0,therelationshipbetweeneachnumberwasadded,suchasasetofbrandtherearebothcard2and4a,thenumberis3times・Onecardistwo,onecardisone,twoisthree・Fourtoonefortwo,orfourofthesameCARDS(thecolorsandNumbersarethesame);Ithappen
3、stobesevenpairsofCARDS・Someagreed:AsetofmahjonggamesthathavebeenplayedandplayedCARDSarecomposedofmultipleboards,whichcanbeapairofCARDS,threeCARDS,threeidenticalCARDS,andfouridenticalCARDS・Thereare14CARDSinagroupofCARDS,withupto18CARDS(whentherearefourtoone)・Runtimelimit:unlimitedMemorylimits:un
4、limitedInput:Astringrepresentsmahjong(whichisguaranteedbytheinputbytheinputperson,andtheprogrammerdoesn,thavetoconsidertheCARDS),suchas1T2T3T.Description:1〃1T〃means1,Tdenotesthestripe,thefrontandthenumberareseveralpoints,thedatarangeis1〜9,theinputpersonguarantees,theprogrammingdoesnotneedtocons
5、idertheinputprescriptivesex;〃4D〃meansfour,Dforabobbin,anumberforanumberofboxes,arangeof1~9,andtheinputpersonassuresthattheprogramdoesnotneedtoconsiderinputprescriptive;Separatedbybetween3.Pot',',theimportertoensurethatthepotarecorrectandsortedbydigitalfromsmalltolarge,programmersdonotneedtojudg
6、ethecorrectnessofthepot:AgroupofCARDSisterminatedbythe〃・“,whichisguaranteedbytheinput,andtheprogrammerdoesnothavetoconsiderthe〃〃■TheinputguaranteesanumberofCARDSinagame,andtheprogrammerdoesn,thavetothinkaboutsorting,whichmeansthatthenumberofCARDSthathaveanumberwillnotbescatteredacrossmultiplebo
7、ards・Output:Thenumberofmahjong,integertype・Thesampleinput:1t2t3t,4t5t6t,7t8t9t,1d2d3d,4d4d.Thesampleoutput:oneAnswerhints:Onlythenumberofoutputs,andtheinteger.ThemaximumincrementisthemaximumincrementDescription:EnteraseriesofNumbe