当前位置 :
英语翻译Amonggrandfather��spapersabillwasfound:72turkeys$_679_Thefirstandthelastdigitsofthenumberthatobviouslyrepresentedthetotalpriceofthoseturkeysarereplacedherebyblanks(denoted_),fortheyarefaded
更新时间: 2025-08-28 10:28:21
1人问答
问题描述:

英语翻译

Amonggrandfather��spapersabillwasfound:

72turkeys$_679_

Thefirstandthelastdigitsofthenumberthatobviouslyrepresentedthetotalpriceofthoseturkeysarereplacedherebyblanks(denoted_),fortheyarefadedandarenowillegible.Whatarethetwofadeddigitsandwhatwasthepriceofoneturkey?

Wewanttowriteaprogramthatsolvesageneralversionoftheaboveproblem:

Nturkeys$_XYZ_

Thetotalnumberofturkeys,N,isbetween1and99,includingboth.Thetotalpriceoriginallyconsistedoffivedigits,butwecanseeonlythethreedigitsinthemiddle.Weassumethatthefirstdigitisnonzero,thatthepriceofoneturkeyisanintegernumberofdollars,andthatalltheturkeyscostthesameprice.

GivenN,X,Y,andZ,writeaprogramthatguessesthetwofadeddigitsandtheoriginalprice.Incasethatthereismorethanonecandidatefortheoriginalprice,theoutputshouldbethemostexpensiveone.Thatis,theprogramistoreportthetwofadeddigitsandthemaximumpriceperturkeyfortheturkeys.

Input

TheinputconsistsofTtestcases.Thenumberoftestcases(T)isgivenonthefirstlineoftheinputfile.ThefirstlineofeachtestcasecontainsanintegerN(0

马跃超回答:
  Amonggrandfather��spapersabillwasfound:   祖父的一叠纸/文件里有张帐单:72个火鸡:$_679_   用来表示火鸡总价的数字的首位和末位由空格(_)表示,因为这两位数字淡化掉看不清了.那么,首位和末位数分别是什么?一只火鸡多少钱?   我们打算写出一个程序来解决上述问题.将上述问题一般化后得到:   N个火鸡:$_XYZ_   火鸡的总数为N,1
最新更新
保卡通(baokatong.com)汇总了汉语字典,新华字典,成语字典,组词,词语,在线查字典,中文字典,英汉字典,在线字典,康熙字典等等,是学生查询学习资料的好帮手,是老师教学的好助手。
声明:本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
Copyright©2009-2021 保卡通 baokatong.com 版权所有