早教吧作业答案频道 -->英语-->
英语翻译L-I-N-G-O:LINGOAsanexample,theproductionstaffchoosesthesecretword:"HELLO".Thecontestantistoldthefirstletterofthewordis"H".Thecontestantthenguesseswhatthewordcouldbe,knowingitbeginswiththeletter"H".Let'ssa
题目详情
英语翻译
L-I-N-G-O:LINGO
As an example,the production staff chooses the secret word:"HELLO".The contestant is told the first letter of the word is "H".The contestant then guesses what the word could be,knowing it begins with the letter "H".Let's say the contestant guesses the word:"HOLES".The game show computer would report that the "H" and "L" are in the secret word and in the correct position.In addition,the "O" and "E" are in the secret word,but in the incorrect position,and the "S" is not in the secret word.This is conveyed to the contestant by a single line report:
HoLe.
The upper case letters ("H" and "L") indicate correct letter and position.The lower case letters ("o" and "e") indicate correct letter,wrong position.The period (".") indicates a wrong letter (not in the secret word).
You will write a program that evaluates the contestant guesses,and prints out the single line report for each guess.If the contestant guesses the secret word exactly,then the five capital letters of the secret word will be displayed in the report.
Input
The input data file consists of datasets for one or more games.A blank line marks the beginning of the next dataset (game).The line after the blank line contains the secret word.The remaining lines in the dataset represent the contestant's guesses; there may be too few or too many guesses than are necessary to guess the secret word.The secret word will contain exactly five upper case letters.The contestant抯 guesses,however,have to be checked for validity:valid guesses consist of exactly five upper case letters.Input is terminated by a dataset with the secret word:"LINGO" (that is,game play is stopped at that point,the program terminates,and no further guessing occurs).
Output
Each game's output should be preceded by a single blank line (except for the terminating case).The first single line status report should be printed,which consists of the first letter of the secret word,followed by four periods.For each guess,print the single line status report for that guess.For an invalid guess,repeat the previous single line status report.If the guess exactly matches the secret word,that game ends and you should move on to the next one.The contestant may guess a maximum of six times; after the sixth guess,if the contestant did not guess the secret word,or you run out of guesses (the contestant gives up) print out the secret word in lower case letters and move on to the next game.
L-I-N-G-O:LINGO
As an example,the production staff chooses the secret word:"HELLO".The contestant is told the first letter of the word is "H".The contestant then guesses what the word could be,knowing it begins with the letter "H".Let's say the contestant guesses the word:"HOLES".The game show computer would report that the "H" and "L" are in the secret word and in the correct position.In addition,the "O" and "E" are in the secret word,but in the incorrect position,and the "S" is not in the secret word.This is conveyed to the contestant by a single line report:
HoLe.
The upper case letters ("H" and "L") indicate correct letter and position.The lower case letters ("o" and "e") indicate correct letter,wrong position.The period (".") indicates a wrong letter (not in the secret word).
You will write a program that evaluates the contestant guesses,and prints out the single line report for each guess.If the contestant guesses the secret word exactly,then the five capital letters of the secret word will be displayed in the report.
Input
The input data file consists of datasets for one or more games.A blank line marks the beginning of the next dataset (game).The line after the blank line contains the secret word.The remaining lines in the dataset represent the contestant's guesses; there may be too few or too many guesses than are necessary to guess the secret word.The secret word will contain exactly five upper case letters.The contestant抯 guesses,however,have to be checked for validity:valid guesses consist of exactly five upper case letters.Input is terminated by a dataset with the secret word:"LINGO" (that is,game play is stopped at that point,the program terminates,and no further guessing occurs).
Output
Each game's output should be preceded by a single blank line (except for the terminating case).The first single line status report should be printed,which consists of the first letter of the secret word,followed by four periods.For each guess,print the single line status report for that guess.For an invalid guess,repeat the previous single line status report.If the guess exactly matches the secret word,that game ends and you should move on to the next one.The contestant may guess a maximum of six times; after the sixth guess,if the contestant did not guess the secret word,or you run out of guesses (the contestant gives up) print out the secret word in lower case letters and move on to the next game.
▼优质解答
答案和解析
作为一个例子,生产人员选择的秘密词:该选手被告知这个词的第一个字母为“H”.该参赛者然后会猜测可能是这个词,知道它与字母“H”开头.让我们猜测说,选手的词:“洞”.游戏节目的计算机会报告中的“H”和“L”是在秘密的文字和在正确的位置.
此外,“O”类和“E”是在秘密的词,但不正确的位置,和“S”是不是在秘密字.这是传达给选手由单一行报告:
洞.
在大写字母(为“H”和“L”)显示正确的字母和立场.小写字母(“0”和“e”)显示正确的字母,错位置.这一时期(".")表示一个错误的信(不是秘密字).
你将写一个程序,用于评估选手猜测,并指出每个guess.If参赛者猜测词准确的秘密,那么5个秘密字大写字母打印单线报告将在报告中显示.
输入
输入数据文件的数据集包含一个或多个游戏.阿空行标志着下一个数据集(游戏)的开始.后的空白行行包含单词的秘密.在DataSet其余线代表选手的猜测,有可能太少或太多猜测比必要的猜测单词的秘密.
秘密字将包含在五个大写字母.该参赛者抯猜测,不过,要检查的有效性:有效的猜测恰好5大写字母组成.输入终止与秘密词集:“LINGO的”(即游戏是在该点停止,程序终止,并没有出现进一步的猜测).
输出
每场比赛的输出之前应该由一个空行(除终止的情况下).第一单线情况报告应印,其中包括对秘密单词的首字母,然后由四个时期.对于每一个猜测,打印该猜测单行情况的报告.对于无效的猜测,重复以前的单一行情况的报告.
如果猜测完全匹配的秘密字,那场比赛结束,你应该进入下一个one.The选手可能会猜6次为限;后的第六猜测,如果参赛者没有猜字的秘密,或者运行出于猜测(该选手放弃)打印出小写字母,并转移到下一场比赛的秘密字.
此外,“O”类和“E”是在秘密的词,但不正确的位置,和“S”是不是在秘密字.这是传达给选手由单一行报告:
洞.
在大写字母(为“H”和“L”)显示正确的字母和立场.小写字母(“0”和“e”)显示正确的字母,错位置.这一时期(".")表示一个错误的信(不是秘密字).
你将写一个程序,用于评估选手猜测,并指出每个guess.If参赛者猜测词准确的秘密,那么5个秘密字大写字母打印单线报告将在报告中显示.
输入
输入数据文件的数据集包含一个或多个游戏.阿空行标志着下一个数据集(游戏)的开始.后的空白行行包含单词的秘密.在DataSet其余线代表选手的猜测,有可能太少或太多猜测比必要的猜测单词的秘密.
秘密字将包含在五个大写字母.该参赛者抯猜测,不过,要检查的有效性:有效的猜测恰好5大写字母组成.输入终止与秘密词集:“LINGO的”(即游戏是在该点停止,程序终止,并没有出现进一步的猜测).
输出
每场比赛的输出之前应该由一个空行(除终止的情况下).第一单线情况报告应印,其中包括对秘密单词的首字母,然后由四个时期.对于每一个猜测,打印该猜测单行情况的报告.对于无效的猜测,重复以前的单一行情况的报告.
如果猜测完全匹配的秘密字,那场比赛结束,你应该进入下一个one.The选手可能会猜6次为限;后的第六猜测,如果参赛者没有猜字的秘密,或者运行出于猜测(该选手放弃)打印出小写字母,并转移到下一场比赛的秘密字.
看了 英语翻译L-I-N-G-O:...的网友还看了以下:
设定义在R上的函数f(x)、g(x)满足f(x)g(x)=ax,且f′(x)g(x)>f(x)g′ 2020-04-07 …
设an=1+1/2+1/3+.1/n,是否存在关于n的正式g(n),使得等式a1+a2+a3+.a 2020-06-12 …
已知f(x)、g(x)都是定义在R上的函数,g(x)≠0,f(x)g(x)=ax,且f′(x)g( 2020-06-16 …
来个人,化学平衡晕死了,我写的对不M(G)+N(G)=P(G)+Q(G)压强一定,不平衡M(G)+ 2020-07-04 …
已知f(n)=-n,φ(n)=,g(n)=n-,n∈N+,则[]A.f(n)<g(n)<φ(n)B 2020-07-13 …
正整数可以分为两个互不相交的正整数子集:{f(1),f(2),f(3)...f(n)...};{g 2020-07-20 …
一个有关大O(阶)的问题求两个单调递增函数f(n)和g(n)(n为自然数),f(n)≠O(g(n) 2020-07-31 …
设f(N)、g(N)是定义在正数集上的正函数.如果存在正的常数C和自然数N0,使得当N≥N0时有f 2020-07-31 …
两道关于函数的增长的证明题1.证明:f(n)=n^100,对g(n)=2^n是O(g)的,但g不是 2020-08-01 …
已知f(x)=bx+1为x的一次函数,b为不等于1的常数,且g(n)=1(n=0)f[g(n-1)] 2020-11-17 …