2 qq 33701809 qq_33701809 于 2016.01.29 17:26 提问

大神请进,帮小孩看一下他的算法,点评点评。 100C

问题如下:
图片说明
图片说明

算法如下:

Algorithm for the programming assignment #2

Algorithm for the game of absorb material

Step1: Welcome the user and explain the purpose of how to use this program to play

Step1a: Display a heading (“absorbing material game”)

Step2: Get the name of players

  ---(step2a)Prompt the user

    “Please input the name of the first player”

  ---Enter the name of first player (player[0])

  ---Read it in the data and store in a char variable

  ---Echo the name of the first player (display it)

    “The first player’s name” amount the variable

  ---Ask the user if the name was correct (Y/N)

  ---If not, re-prompt and read until the user player is happy (repeat step 2a)

  ---(step 2b)Prompt the user again

    “Please input the name of the second player”

  ---Enter the name of second player (player[1])

  ---Read it in the data and store in a char variable

  ---Echo the name of the second player (display it)

    “The second player’s name”amount the variable

  ---Ask the user if the name was correct(Y/N)

  ---If not, re-prompt and read until the user player is happy (repeat step 2b)

Step3: Distribute the points

  ---(step 3a)Prompt the first user

    “Please input the points of the game! (10 points)”

  ---Enter the number of the points ( int a)

  ---Read it in the data and store it in a int variable

  ---Echo the number of the points (display it)

    “The number of the points at the before beginning the game”amount the variable

  ---Ask the user if the points meet with the requirement of the game(Y/N)

  ---If not, re-prompt and read until meet with the requirement (repeat step 3a)

  ---(step 3b)Prompt the second user

    “Please input the points of the game! (10 points)”

  ---Enter the number of the points (int b)

  ---Read it in the data and store it in a int variable

  ---Echo the number of the points (display it)

    “The number of the points at the before beginning the game”amount the variable

  ---Ask the user if the points meet with the requirement of the game(Y/N)

  ---If not, re-prompt and read until meet with the requirement (repeat step 3b)

Step4: Enter the question

  ---(step 4a)Prompt the first player

    “Please input the question on the screen”

  ---Enter the question (char question[])

  ---Count the number of words of the question and store it in a int variable (int c)

  ---Read it in the data and store it in a char variable

  ---Echo the question (display it)

    “The question is” among the variable

  ---Ask the first player if the question is correct(Y/N)

  ---If not, re-prompt and read until the user is happy (repeat step 4a)

Step5: Clear the question

  ---Prompt the second player

    “Don’t see the problem when the first player enter the question”

  ---Display the question and disappear quickly( type the enter key)

Step6: Show the question for the second player

  ---Prompt the second player

    “Are you ready to see the question and you have only three seconds to see (Y/N)”

  ---Enter the answer (char ch1)

  ---If the answer is Y (y)

  ---Read it in the data and store it in a char variable

  ---Echo the answer (display it)

    “Your answer is”among the variable

  ---If yes, then do the next step

  ---Echo the time left (display it)

    “Time-left:”among the positive number

Step7: Memory the question

  ---Prompt the second player

    “You have five seconds to recall the question”

  ---Echo the time left (display it)

    “Time-left:”among the positive number

Step8: Try to relax

  ---Prompt the second player

    “Relax yourself before answering the question”

Step9: Is ready for the second player

  ---(step 9a)Prompt the second player

    “Are you ready to answer the question? (Y/N)”

  ---Enter the answer (char ch2)

  ---Read it in the data and store it in a char variable

  ---Echo the answer (display it)
    “Your answer is”among the variable

  ---Ask the second player if the answer is correct(Y/N)

  ---If not, re-prompt and read until the meet with the second player’s requirement

    (repeat step 9a)

  ---If the second player answer is no

  ---Read it in the data and store it in a char variable

  ---(step 9b)Prompt the second player

    “This time you have 30 seconds to see this question and remember it, but your

     Points will deducted” (points=points-1)

  ---Read the points in the data and store it in a integer variable

  ---Show the question on the screen

  ---Echo the time left (display it)

    “Time-left:”among the positive number

  ---Prompt the second player

    “You have ten seconds to recall the answer”

  ---Echo the time left (display it)

    “Time-left:” among the positive number

  ---Prompt the second player

    “Relax yourself before typing the question”

Step10: Begin to type the question

  ---Prompt the second player

    “Begin to type the question”

  ---Enter the question (char question1[])

  ---Count the number of words of the question1 and store it in a int variable (int d)

  ---Read it in the data and store it in a char variable

Step11: Compare the number of words

  ---(step 11a)If the number of words in the same and the word(Y/N)

  ---If yes, then do the next step

  ---Echo a sentence (display it)

    “You do a great job! And you can add one point to your points” (points=points+1)”

  ---Read it in the data and store it

  ---If no, then do the next step

  ---Echo a sentence (display it)

    “Your point need to deducted by one point” (points=points-1)

  ---Read it in the data and store it

Step12: Switch turns

  ---Prompt the player

    “The position of the player changes”

  ---Repeat the step from step 4 to step12 until one player has no point

Step13: Game over

  ---Prompt the player

    “Who don’t have points?”

  ---If the first player don’t have points

  ---Echo a sentence (display it)

    “The second player win the game”

  ---If the second player don’t have points

  ---Echo a sentence (display it)

    “The first player win the game”

Step14: Re-play the game

  ---Prompt the player

    “Do you want to play again? (Y/N)”

  ---If yes, then repeat the step from step2 to step13

  ---If no, then exit the game

Step15: Thank you for using this program to play

6个回答

devmiao
devmiao   Ds   Rxr 2016.01.29 22:32

建议你去外语学院问,这个和编程没关系了。

enpterexpress
enpterexpress   Rxr 2016.01.29 23:18

图片说明图片说明图片说明没必要这样

WinsenJiansbomber
WinsenJiansbomber   2016.01.30 06:50

一句点评,您孩子外语真不错,流程图理解得挺好,关键是有礼貌。

RSVP(Rapid Serial Visual Presentation) Game Developing:
STEP 1
Step1: Welcome the user and explain the purpose of how to use this program to play
Step1a: Display a heading (“absorbing material game”)
Step2: Get the name of players
 and more ...
Step3: Distribute the points
 and more ...
Step4: Enter the question
 and more ...
Step5: Clear the question
 and more ...
Step6: Show the question for the second player
 and more ...
Step7: Memory the question
 and more ...
Step8: Try to relax
 and more ...
Step9: Is ready for the second player
 and more ...
Step10: Begin to type the question
 and more ...
Step11: Compare the number of words
 and more ...
Step12: Switch turns
 and more ...
Step13: Game over
 and more ...
Step14: Re-play the game
 and more ...
Step15: Thank you for using this program to play 
peiyuanxin
peiyuanxin   2016.01.31 10:28

我好累。 不认识。肿么办图片说明

fk002008
fk002008   2016.02.01 00:33

还是英语的啊

建议把流程图画出来

Acmen99
Acmen99   2016.02.03 16:23

字典翻的好累!真心不认识它们!

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!
其他相关推荐
2015美团点评算法工程师笔试和面试题整理
2010年3月4日成立的团购网站。美团网有着“美团一次,美一次”的宣传口号。为消费者发现最值得信赖的商家,让消费者享受超低折扣的优质服务;为商家找到最合适的消费者,给商家提供最大收益的互联网推广。 本文是一篇2015美团算法工程师三面面经,包括笔试、面试题,感兴趣的同学参考下。    9月16日下午进行了美团笔试,8个大题+若干附加题(其它岗位选做),笔试题就不多说了,基本
美团点评编程大赛题目疑问
题目描述 美团外卖的品牌代言人袋鼠先生最近正在进行音乐研究。他有两段音频,每段音频是一个表示音高的序列。现在袋鼠先生想要在第二段音频中找出与第一段音频最相近的部分。 具体地说,就是在第二段音频中找到一个长度和第一段音频相等且是连续的子序列,使得它们的 difference 最小。两段等长音频的 difference 定义为: difference = SUM(a[i] -
2018美团点评编程题第一题
晚上参加美团的笔试,今天从坐了一天的车,到了学校匆忙吃了饭,然后就开始了。确实是,脑子有点不灵光。编程的第一题: 给定一个序列,输出这个序列子串的和为K的倍数的子串的长度,如果有重复,输出最大长度。 例如:序列为:{1,2,3,4,5} k = 5 那么子串的和为5的倍数的有{2,3},{1,2,3,4},{1,2,3,4,5},{5} ,而这时长度最大的是5,所以输出5。刚开始看到这道题,
美团点评前端面试
基础很重要!!! 某互联网公司一面 在地址栏输入URL,回车后都发生了什么 Html5和之前的版本有什么不同和改进优势 说说bootstrap的原理 在百度搜索框输入关键字,回车都发生了什么 说说你之前或者最近做过的一些项目,用到的一些技术 二叉树有了解吗 虚拟机 某知名互联网公司二 自我介绍一下 iphone手机端打开视频
MDD Cup 2017 小记 (美团点评内部算法比赛)
gbdt版本     MDD Cup 2017,是美团点评内部首届算法大赛,主要是预测外卖的送达时间,是一个回归问题,简单说一说比赛过程自己的所思所想,记录一下。     拿到数据后,根据大赛的说明简单分析了一下,训练集给出的是一个月的部分数据,测试集是下一个月的数据,需要注意的是训练集给出的是每天24h的数据,而测试集只需要预测11点和17点高峰时期两个小时的数据,而且给出了
2017美团点评前端开发岗位面试题
一面:一面的面试官主要根据我的陈述进行提问,所以切记千万不要给自己挖坑。。。1、自我介绍2、怎样学习前端的?3、都看了哪些技术博客?(因为我回答上题的时候说经常会看一些博客)4、最近接触到哪些前端的技术,正在学习的?5、你认为对前端来说,什么样的代码才算是好的代码?6、js除了原型继承还有哪些其他的继承方式?(因为我说最近看了原型链继承)7、对主流框架了解多少,比如Vue、React等等?8、怎么...
美团点评前端面试小结
美团点评前端开发面试小结
在美团点评工作感觉
    本人在上海美团点评公司,进入工作快两个月了所以写点博客来纪念下在美团点评工作感觉。        先谈谈上海,总体来说,上海和我最初对他的影响有些不一样,原本人物在上海的生活会以一个快字来形容,但是感觉来到上海的第一个月的工作更多的是感觉效率。在美团也是一样,相比与其他的互联网公司来说,美团点评公司比较注重效率,时间上不会太过于强求,每一周都会给予你相应的工作量,但是并不是很多,美团会给...
点评cat-client解析
点评cat-client源码分析
美团点评面试有感
下午从西边千里迢迢跑到东边去面试,总体感觉就是两个字:挂了。整个流程下来,对自己也是挺失望的,但失望中却又萌生出一种强烈的学习欲望,从今年开学以来,对机器学习进行了一次知识上的突击,很多时候,都只是满足于自己看懂某些公式,会推导某些公式。但今天面试的时候,面试官很多时候都会问一些细节的东西,这些东西都是需要去积累的。并且自己对几个经典模型的推导还没有滚瓜烂熟,很多算法只知表面原理是不够的。所以,我