小鑫の日常系列故事(二)——石头剪子布

Input

 输入有两行,每一行都有可能为“Rock”(石头),“Scissors”(剪子),”Cloth”(布)。第一行为小鑫的选择,第二行为健健的选择。

Output

 输出有一行,如果小鑫赢了输出“Win”,输了输出“Lose”,平局输出“Equal”。(输出不包括引号)

Sample Input

Rock
Scissors

Sample Output

Win

参考代码

#include
#include
int main()
{
 char s1[10],s2[10];
 gets(s1);
 gets(s2);
 if(strcmp(s1,"Rock")==0)
 {
  if(strcmp(s2,"Scissors")==0)
   printf("Win\n");
  else if(strcmp(s2,"Cloth")==0)
   printf("Lose\n");
  else
   printf("Equal\n");
 }
 else if(strcmp(s1,"Cloth")==0)
 {
  if(strcmp(s2,"Scissors")==0)
   printf("Lose\n");
  else if(strcmp(s2,"Rock")==0)
   printf("Win\n");
  else
   printf("Equal\n");
 }
 else if(strcmp(s1,"Scissors")==0)
 {
  if(strcmp(s2,"Rock")==0)
   printf("Lose\n");
  else if(strcmp(s2,"Cloth")==0)
   printf("Win\n");
  else
   printf("Equal\n");
 }
 return 0;
}

你可能感兴趣的:(小鑫の日常系列故事(二)——石头剪子布)