标签:石头 rgba style turn nbsp clu pre scan int
1 #include<stdio.h> 2 #include<time.h> 3 #include<stdlib.h> 4 5 int main() 6 { 7 time_t t; 8 int man,computer,sum; 9 t= time(NULL); 10 11 srand(t); 12 computer = rand()%3;+1; 13 printf("请出拳(1剪刀/2石头/3布)"); 14 scanf("%d",&man); 15 man = man*3;//乘以3是为了计算方便 16 sum = man+computer; 17 18 if (sum == 4||sum == 8|| sum==12) 19 { 20 printf("打平了"); 21 } 22 if (sum == 10||sum==5||sum==9) 23 { 24 printf("电脑赢了"); 25 } 26 if (sum == 6||sum==7||sum==11) 27 { 28 printf("人赢了"); 29 } 30 return 0; 31 }
标签:石头 rgba style turn nbsp clu pre scan int
原文地址:https://www.cnblogs.com/elapstjtl/p/13773408.html