2001:K-In-A-RowHansel and Gretel do not listen to their teac

touch43422022-10-04 11:39:541条回答

2001:K-In-A-Row
Hansel and Gretel do not listen to their teacher at school.Instead they secretly play a game called K-In-A-Row.One day in the evening they started to argue who had won more games that day.They collected all the papers they had used for playing the game and they started to count how many times each of them had won.But it was very tedious and they were sleepy.Help them to count how many games each of them had won.
K-In-A-Row is played in a square grid with M times N squares.Two players alternate in their moves.A player chooses an empty square and fills in his/her sign (Hansel uses cross 'x' and Gretel uses circle 'o').The game is won by the player who first places at least K his/her own signs in a row (either horizontally,vertically or in one of the two diagonal directions).The game stops immediately after one of the players completes K of his/her signs in a row; thus it may never happen that both players have completed K of their signs in a row.If no player creates such a row,nobody wins.
Input Specification
The input file may contain more than one test case.The first line of each test case contains the number of games L.It is followed by L blocks,each describing one game.Each block starts with a line containing 3 numbers M,N and K.Numbers M and N give the size of the grid (M,N

已提交,审核后显示!提交回复

共1条回复
魔天苍狼1 共回答了20个问题 | 采纳率85%
#include
#include
using namespace std;
int dir[4][2] = {1,0,1,1,0,1,1,-1};
char gameboard[202][202];
int main()
{
x05int L;
x05cin >> L;
x05int Han=0,Gretel=0;
x05while(L--)
x05{
x05x05int M,N,K;
x05x05memset(gameboard,'.',sizeof(gameboard));
x05x05cin >> M >> N >> K;
x05x05for(int i=1;i gameboard[i][j];
x05x05x05}
x05x05for(int i=1;i
1年前

相关推荐

英语八年级下学期第六单元课文2d部分hansel and gretel翻译
qiutao6111年前1
猪行ff 共回答了18个问题 | 采纳率94.4%
Hansel and GretelHansel and Gretel lived near a forest with their father and stepmother. One year, the weather was so dry that no food would grow. The wife told her husband that unless he left the children to die in the forest, the whole family would die. Gretel heard this, and Hansel made a plan to save himself and his sister.
•Scene one:The children learn that something bad is going to happen.Gretel:Did you hear our stepmother planning to kill us? Hansel:Don’t worry! I have a plan to save us. Gretel:How can you save us? Hansel:Be quiet! I am going outside to get something in the moonlight. Now, go to sleep.
•Scene two:The children wake up.Wife:Get up, lazy children! Husband:Yes, dears. You must come with me to the forest to get wood. Wife:Here is some bread. Don’t eat it until you get to the forest.
•Scene three:Gretel learns about Hansel's plan.Gretel:Hansel, what are you doing? Hansel:I’m dropping white stones along the way. Unless I do, we’ll be lost. Tonight, when the moon is shining bright, we’ll be able to see the stones.
#8226;Scene four:The children surprise the parents.Wife:You bad children! What a long time you slept in the forest! Husband:We thought you were never coming back. Wife:Now , go to bed. As soon as you wake up, you must go to the forest with your father. Hansel:What, again? I want to go out to look at the moon. Wife:No. you can’t go out now.
•Scene five:Hansel has to change his plan.Gretel:What can we do? You have no more stones. Hansel:I’ll drop pieces of bread. As soon as the moon rises, we can follow them instead.
•Scene six:The children cannot find the pieces of bread.Gretel:I can’t see any bread on the ground. Maybe it was the birds. Hansel:Never mind! Just keep walking. Unless we do, we won’t find our way out.

•Scene seve:The children get lost.Gretel:Hansel,we‘re really lost!Hansel:Listen!That bird's song is so beautiful that we should follow it.Gretel:Look!It's leading us to that wonderful house made of bread,cake and candy.Hansel:Let's eat part of the house!(Then they hear an old woman's voice from inside the house.)Voice:Who is that?Who is brave enough to eat my house?
翻译:汉瑟和葛丽特汉瑟和葛丽特与他们的父亲和继母住在森林。有一年,天气太干燥了,食物不会生长。妻子告诉丈夫,除非他让孩子们死在森林中,否则整个家庭都会死的。葛丽特听到这,并且汉斯制定了一个计划来拯救自己和他的妹妹。场景一:孩子们意识到将有一些坏事发生。 葛丽特:你听到我们的继母打算杀了我们? 汉瑟:别担心!我有一个计划来拯救我们。 葛丽特:你怎样拯救我们? 汉瑟:安静!我将要到外面去在月光下找一些东西。所以现在,你去睡觉。场景二:孩子们被叫醒。 妻子:快起床,懒孩子! 丈夫:是的,亲爱的。你们要跟我到森林里去取木。 妻子:这里是一些面包。不要吃它,直到你到达森林。场景三:葛丽特了解了汉瑟的计划。 葛丽特:汉斯,你在做什么? 汉瑟:我正沿路撒白石头。如果我不这样做,我们会迷路。今晚,当月亮照耀时,我们就能 看到白色的石头。场景四:孩子们的回归使得父母很惊讶。 妻子:你个坏孩子!你怎么睡在森林里那么长时间! 丈夫:我们以为你不会回来了。 妻子:现在,去睡觉。只要你们醒来,必须与你父亲去森林。 汉瑟:什么,再一次吗?我想外出看月亮。 妻子:不。你现在不能出去。场景五:汉瑟不得不改变他的计划。 葛丽特:我们能做什么?你没有更多的石头了。 汉瑟:我会带一些面包片。当月亮升起的时候,我们可以跟随他们。场景六:汉子们不能找到面包片了。 葛丽特:我看不到地上的任何面包。也许是鸟吃了。 汉瑟:没关系!只要一直走。除非我们这样做,否则我们不会找到我们的出路。场景七:孩子们迷路了。 葛丽特:汉瑟,我们迷路了。 汉瑟:听!那只鸟的歌是如此的美妙,我们可以跟着它。 葛丽特:看!它正引领着我们去到那个由面包、蛋糕和糖果打造的美妙的房子。 汉瑟:让我们吃掉房子的一部分吧。(之后他们听到来自屋里一个老女人的声音。)声音:那是谁?谁那么足够勇敢吃我的房子?
双语对照。希望能帮助你。。O(∩_∩)O~
英语hansel and gretel转述为第三人称单数
huamulan5101年前1
saterly 共回答了23个问题 | 采纳率95.7%
hansels
gretels
改变句型: Hansel and Gretel find their way back home.
改变句型: Hansel and Gretel find their way back home.
改变句型:
Hansel and Gretel find their way back home.改成一般疑问句
谢谢!
kikoWong1年前1
fybyjj 共回答了17个问题 | 采纳率94.1%
Do Hansel and Gretel find their way home?