-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1873 - PEDRA-PAPEL
43 lines (38 loc) · 1.26 KB
/
1873 - PEDRA-PAPEL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include <string.h>
#include <stdio.h>
int main(){
int C;
char rajesh[11], sheldon[11];
scanf("%d\n", &C);
for(int i = 0; i < C; ++i){
scanf("%s %s\n", &rajesh, &sheldon);
if(!strcmp(rajesh, sheldon)){
printf("empate\n");
}else if(!strcmp(rajesh, "pedra")){
if(!strcmp(sheldon, "tesoura") || !strcmp(sheldon, "lagarto"))
printf("rajesh\n");
else
printf("sheldon\n");
}else if(!strcmp(rajesh, "papel")){
if(!strcmp(sheldon, "pedra") || !strcmp(sheldon, "spock"))
printf("rajesh\n");
else
printf("sheldon\n");
}else if(!strcmp(rajesh, "tesoura")){
if(!strcmp(sheldon, "papel") || !strcmp(sheldon, "lagarto"))
printf("rajesh\n");
else
printf("sheldon\n");
}else if(!strcmp(rajesh, "lagarto")){
if(!strcmp(sheldon, "papel") || !strcmp(sheldon, "spock"))
printf("rajesh\n");
else
printf("sheldon\n");
}else if(!strcmp(sheldon, "pedra") || !strcmp(sheldon, "tesoura"))
printf("rajesh\n");
else
printf("sheldon\n");
}
}
return 0;
}