1 solutions
-
0
C :
#include<stdio.h> void main(){ int t,k; scanf("%d%d",&t,&k); if(t==k){ printf("tie"); }else{ if(t==1 && k==2){ printf("win"); }else if(t==1 && k==3){ printf("lose"); }else if(t==2 && k==1){ printf("lose"); }else if(t==2 && k==3){ printf("win"); }else if(t==3 && k==1){ printf("win"); }else if(t==3 && k==2){ printf("lose"); } } }
C++ :
#include<iostream> using namespace std; int main(){ int a,b; cin>>a>>b; if(a==1&&b==2 ||a==2&&b==3 ||a==3&&b==1){ cout<<"win"<<endl; }else{ if(a==b){ cout<<"tie"<<endl; }else{ cout<<"lose"<<endl; } } }
Python :
a,b = map(int,input().split()); if b - a != 2: if a < b: print('win') elif a == b: print('tie') elif a - b == 2: print('win') else : print('lose') else: print('lose')
- 1
Information
- ID
- 10821
- Time
- 1000ms
- Memory
- 16MiB
- Difficulty
- (None)
- Tags
- # Submissions
- 0
- Accepted
- 0
- Uploaded By