小鑫の日常系列故事(二)——石头剪子布 (sdut oj)
来源:互联网 发布:python跨文件调用函数 编辑:程序博客网 时间:2024/04/30 06:13
小鑫の日常系列故事(二)——石头剪子布
Time Limit: 1000MS Memory Limit: 65536KB
Problem Description
小鑫在上幼儿园的时候,喜欢跟小伙伴健健玩石头剪子布的游戏 ,你能帮他们判断谁胜谁负么?
Input
输入有两行,每一行都有可能为“Rock”(石头),“Scissors”(剪子),”Cloth”(布)。第一行为小鑫的选择,第二行为健健的选择。
Output
输出有一行,如果小鑫赢了输出“Win”,输了输出“Lose”,平局输出“Equal”。(输出不包括引号)
Example Input
RockScissors
Example Output
Win
Hint
Author
lin
参考代码
#include<stdio.h>#include<string.h>int main(){ char a[100]; char b[100]; gets(a); gets(b); if (strcmp(a, "Rock") == 0 && strcmp(b, "Rock") == 0) printf("Equal\n"); if (strcmp(a, "Rock") == 0 && strcmp(b, "Scissors") == 0) printf("Win\n"); if (strcmp(a, "Rock") == 0 && strcmp(b, "Cloth") == 0) printf("Lose\n"); if (strcmp(a, "Scissors") == 0 && strcmp(b, "Scissors") == 0) printf("Equal\n"); if (strcmp(a, "Scissors") == 0 && strcmp(b, "Rock") == 0) printf("Lose\n"); if (strcmp(a, "Scissors") == 0 && strcmp(b, "Cloth") == 0) printf("Win\n"); if (strcmp(a, "Cloth") == 0 && strcmp(b, "Cloth") == 0) printf("Equal\n"); if (strcmp(a, "Cloth") == 0 && strcmp(b, "Rock") == 0) printf("Win\n"); if (strcmp(a, "Cloth") == 0 && strcmp(b, "Scissors") == 0) printf("Lose\n"); return 0;}
参考代码
#include<stdio.h>#include<string.h>int main(){ char a[100]; char b[100]; gets(a); gets(b); if (strcmp(a, "Rock") == 0 && strcmp(b, "Rock") == 0) printf("Equal\n"); if (strcmp(a, "Rock") == 0 && strcmp(b, "Scissors") == 0) printf("Win\n"); if (strcmp(a, "Rock") == 0 && strcmp(b, "Cloth") == 0) printf("Lose\n"); if (strcmp(a, "Scissors") == 0 && strcmp(b, "Scissors") == 0) printf("Equal\n"); if (strcmp(a, "Scissors") == 0 && strcmp(b, "Rock") == 0) printf("Lose\n"); if (strcmp(a, "Scissors") == 0 && strcmp(b, "Cloth") == 0) printf("Win\n"); if (strcmp(a, "Cloth") == 0 && strcmp(b, "Cloth") == 0) printf("Equal\n"); if (strcmp(a, "Cloth") == 0 && strcmp(b, "Rock") == 0) printf("Win\n"); if (strcmp(a, "Cloth") == 0 && strcmp(b, "Scissors") == 0) printf("Lose\n"); return 0;}
0 0
- 小鑫の日常系列故事(二)——石头剪子布 (sdut oj)
- SDUT-2733 小鑫の日常系列故事(二)——石头剪子布
- SDUT ACM 实验九 小鑫の日常系列故事(二)——石头剪子布
- 小鑫の日常系列故事(二)——石头剪子布
- 小鑫の日常系列故事(二)——石头剪子布
- 小鑫の日常系列故事(二)——石头剪子布
- 小鑫の日常系列故事(二)——石头剪子布
- 小鑫の日常系列故事(二)——石头剪子布
- 小鑫の日常系列故事(二)——石头剪子布
- 小鑫の日常系列故事(二)——石头剪子布
- 小鑫の日常系列故事(七)——小纸条 (sdut oj)
- 小鑫の日常系列故事(一)——判断对错 (sdut oj)
- 小鑫の日常系列故事(六)——奇遇记 (sdut oj)
- 小鑫の日常系列故事(五)——卡片游戏 (sdut oj)
- 小鑫の日常系列故事(十)——排名次 (sdut oj)
- SDUT 小鑫の日常系列故事(七)——小纸条
- SDUT 小鑫の日常系列故事(十)——排名次
- SDUT-2737 小鑫の日常系列故事(六)——奇遇记
- Markdown-06UML序列图
- 数据结构颓废计划V-ZKW线段树
- 文章标题
- C#语言—敲代码中的小常识
- 最小乘积(基本型)
- 小鑫の日常系列故事(二)——石头剪子布 (sdut oj)
- TensorFlow介绍
- mongoose基本操作
- hihocoder 1268 九宫 dfs
- 1008: [HNOI2008]越狱
- 小知识2
- 交换与路由知识点总结(二)
- ubuntu下如何转换python的版本
- Linux命令--scp命令