1. 程式人生 > >小鑫の日常系列故事(二)——石頭剪子布 SDUT

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

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

Time Limit: 1000 ms Memory Limit: 65536 KiB

Submit Statistic
Problem Description

小鑫在上幼兒園的時候,喜歡跟小夥伴健健玩石頭剪子布的遊戲 ,你能幫他們判斷誰勝誰負麼?

Input

輸入有兩行,每一行都有可能為“Rock”(石頭),“Scissors”(剪子),”Cloth”(布)。第一行為小鑫的選擇,第二行為健健的選擇。

Output

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

Sample Input

Rock
Scissors

Sample Output

Win

#include<stdio.h>
#include<string.h>
int main()
{
char a[10], b[10];
gets(a);
gets(b);
if(strcmp(a,“Rock”)==0&&strcmp(b,“Scissors”)==0)
{
printf(“Win\n”);
}
if(strcmp(a,“Rock”)==0&&strcmp(b,“Rock”)==0)
{
printf(“Equal\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,“Scissors”)==0)
{
printf(“Lose\n”);
}
if(strcmp(a,“Cloth”)==0&&strcmp(b,“Rock”)==0)
{
printf(“Win\n”);
}
if(strcmp(a,“Cloth”)==0&&strcmp(b,“Cloth”)==0)
{
printf(“Equal\n”);
}
return 0;
}

/***************************************************
User name: jk180233李清璇
Result: Accepted
Take time: 0ms
Take Memory: 180KB
Submit time: 2018-11-22 18:02:42
****************************************************/