#include "stdio.h"
#include "stdlib.h"
#include "time.h" //随机函数的头文件
main()
{
int a,game,c=;
while(c)
{
srand((unsigned)time(NULL)); //按照时间改变来做随机
game=rand()%; //让电脑随机输出1、2、3
printf("你出什么?\n1.布\n2.锤子\n3.剪刀\n4.不玩了\n");
scanf("%d",&a);
system("cls");
if(a>){printf("请按任意键退出!"); break;}
else if(a==game)printf("平局!\n") ;
else if(a==&&game==)printf("你赢了!\n");
else if(a==&&game==)printf("你输了!\n");
else if(a==&&game==)printf("你输了!\n");
else if(a==&&game==)printf("你赢了!\n");
else if(a==&&game==)printf("你赢了!\n");
else if(a==&&game==)printf("你输了!\n");
switch(game)
{
case : printf("电脑出布\n"); break;
case : printf("电脑出锤子\n"); break;
case : printf("电脑出剪刀\n"); break;
} }
}