解题思路:
注意事项:
参考代码:
#include<stdio.h>
enum game {stone, cloth, scissors};
int main(void)
{
enum game hand1, hand2;
scanf("%d %d", &hand1, &hand2);
if (hand1 == hand2)
printf("0");
else if (hand1 == 0 && hand2 == 2)
printf("1");
else if (hand1 == 1 && hand2 == 0)
printf("1");
else if (hand1 == 2 && hand2 == 1)
printf("1");
else
printf("-1");
return 0;
}
0.0分
0 人评分
C语言程序设计教程(第三版)课后习题5.7 (C语言代码)浏览:636 |
C语言训练-排序问题<1> (C语言代码)浏览:1351 |
【回文数(二)】 (C语言代码)浏览:730 |
WU-小九九 (C++代码)浏览:1684 |
【明明的随机数】 (C语言代码)浏览:787 |
蛇行矩阵 (C语言代码)浏览:535 |
a+b浏览:433 |
数对 (C语言代码)浏览:702 |
2004年秋浙江省计算机等级考试二级C 编程题(1) (C语言代码)浏览:324 |
敲七 (C语言代码)浏览:2701 |