8 条题解

  • 2
    @ 2024-11-13 13:00:14

    #include<bits/stdc++.h> using namespace std; int main() { int a,b; cin>>a>>b; if(a1&&b2||a2&&b3||a3&&b1) { cout<<"win"; } else if(ab) { cout<<"tie"; } else if(b1&&a2||b2&&a3||b3&&a==1) { cout<<"lose"; } return 0; }

    • 1
      @ 2023-12-27 13:03:35
      #include<bits/stdc++.h> 
      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";
        }
        else if(a==b)
        {
        	cout<<"tie";
        }
        if(a==2 && b==1 || a==3 && b==2 || a==1 && b==3)
        {
        	cout<<"lose";
        }
        return 0; 
      }
      
      • 0
        @ 2024-11-9 13:56:34

        #include<bits/stdc++.h> using namespace std; int main() { int a,b; cin>>a>>b; if((a+1)b) cout<<"win"; if(a3&&b1) cout<<"win"; if((b+1)a) cout<<"lose"; if(a1&&b3) cout<<"lose"; if(a==b) cout<<"tie"; return 0; }

        • 0

          不难想到输入两数之间的差值若是一则有一种对应关系;同理就能写出差值为二与差值为零;就可以尽量少的分情况🎉️

          #include<bits/stdc++.h> using namespace std; int main() { int a,b; cin>>a>>b; if(a>b) { if(a-b1) { cout<<"lose"<<endl; } if(a-b2) { cout<<"win"<<endl; } } else if(b>a) { if(b-a1) { cout<<"win"<<endl; } if(b-a2) { cout<<"lose"<<endl; } } else if(a==b) { cout<<"tie"<<endl; } return 0; }

          • 0
            @ 2024-10-16 22:27:57
            #include<bits/stdc++.h> 
            using namespace std; 
            int main() 
            { 
             int a,b;
             cin>>a>>b;
             if(a==b)
              cout<<"tie";
             if((a+1)==b)
              cout<<"win";
             if(a==3&&b==1)
              cout<<"win";
             if((b+1)==a)
              cout<<"lose";
             if(a==1&&b==3)
              cout<<"lose";
             return 0; 
            }
            
            • 0
              @ 2024-1-8 13:32:42

              #include<bits/stdc++.h> using namespace std; int main() { int a,b,n,i,k,m,l,sum=0; cin>>a>>b; if((a1&&b2)||(a2&&b3)||(a3&&b1)) { cout<<"win"<<endl; } else if(a==b) { cout<<"tie"<<endl; } else cout<<"lose"<<endl; return 0; }

              • 0
                @ 2023-12-31 14:59:16

                #include<bits/stdc++.h> using namespace std; int main() { int a,b; cin>>a>>b; if(a1 && b2 || a2 && b3 || a3 && b1) { cout<<"win"; } else if(ab) { cout<<"tie"; } if(a2 && b1 || a3 && b2 || a1 && b==3) { cout<<"lose"; } return 0; }

                • 0
                  @ 2023-12-28 1:08:36

                  #include <stdio.h>

                  int main() { int T, K; scanf("%d %d", &T, &K); // 读取小T和小K的出拳

                  // 判断胜负
                  if ((T == 1 && K == 2) || (T == 2 && K == 3) || (T == 3 && K == 1)) {
                      printf("win\n"); // 小T胜
                  } else if (T == K) {
                      printf("tie\n"); // 平局
                  } else {
                      printf("lose\n"); // 小T输
                  }
                  
                  return 0;
                  

                  }

                  • 1

                  信息

                  ID
                  36
                  时间
                  1000ms
                  内存
                  256MiB
                  难度
                  1
                  标签
                  递交数
                  121
                  已通过
                  84
                  上传者