请大家看看这程序错在哪里了?
下面是我写的一段石头剪刀布的游戏,但是现在一运行就要我输入两次数字,我也不知道错在哪里,请大家帮我纠正一下吧。如果要程序不结束,继续多玩几局,然后显示出你几胜几拜,这又改怎么修改呢?小弟万分感谢#include <stdio.h>
#include <stdlib.h>
#include <time.h>
main()
{
int Player , Computer;
printf ( " Start the game already\n " );
printf ( " Plese input a number\n 1 Scissors\n 2 Rock\n 3 Paper\n " );
scanf ( " %d ", &Player);
if ( Player >= 4 || Player <= 0 )
printf ( " Input error!\nPlease input again!\n " );
else
srand ( time ( NULL ) );
Computer = 1 + rand() % 3;
if ( Computer == Player ) printf ( "Ping Ju!\n" ); else
if ( ( Player - Computer ) == -1 ) printf ( "YOU WIN!\n" ); else
if ( Player == 1 && Computer == 3) printf ( "YOU WIN!\n" ); else
printf("YOU LOSE!\n");
}
[[it] 本帖最后由 hopepark 于 2008-9-12 20:59 编辑 [/it]]