54 条题解

  • -1
    @ 2023-8-14 21:09:56
    #include <bits/stdc++.h> 
    using namespace std;
    int main()
    {
        int n,x;
        cin>>n>>x;
        if(n==1 && x==1 or n==2 && x==2 or n==3 && x==3)
        {
            cout<<"tie";
        }
        if(n==1 && x==2 or n==2 && x==3 or n==3 && x==1)
        {
            cout<<"win";
        }
        if(n==1 && x==3 or n==2 && x==1 or n==3 && x==2)
        {
            cout<<"lose";
        }
        return 0;
    }
    
    • -1
      @ 2022-10-16 20:58:04

      不说了自己看

      #include <bits/stdc++.h>
      using namespace std;
      int t,k;
      int main()
      {
          cin>>t>>k;
          if (t==k)
          {
              cout<<"tie";
          }
          else if (t==1 && k==2 || t==2 && k==3 || t==3 && k==1)
          {
              cout<<"win";
          }
          else
          {
              cout<<"lose";
          }
          return 0;
      }
      
    • -2
      @ 2024-6-15 12:47:28
      #include <iostream>
      using namespace std;
      int main()
      {
          int t, k;  
          cin >> t >> k;
          if ((t == 1 && k == 2) || (t == 2 && k == 3) || (t == 3 && k == 1))
              cout << "win";
          else if (t == k)
              cout << "tie";
          else
              cout << "lose";
          return 0;
      }
      
      • -2
        @ 2023-11-26 11:31:55
        #include <iostream>
        using namespace std;
        int main()
        {
            int t, k;  
            cin >> t >> k;
            if ((t == 1 && k == 2) || (t == 2 && k == 3) || (t == 3 && k == 1))
                cout << "win";
            else if (t == k)
                cout << "tie";
            else
                cout << "lose";
            return 0;
        }
        
        • -2
          @ 2023-8-28 18:20:05
          #include <iostream>
          using namespace std;
          int main()
          {
              int n,b;
              cin>>n,b;
              if (n==b)
              {
                  cout<<"tie";
              }
              else
              {
                  if ((n==1 and b==2) or (n==2 and b==3) or (n==3 and b==1))
                  {
                      cout<<"win";
                  }
                  else
                  {
                      cout<<"lose";
                  }
              }
              return 0;
          }
          

          之前发布过一次, 发现了一个错误, 所以重发了一次题解。 (当然已经把错误改过来了......)

          • -2
            @ 2023-8-18 18:14:54

            #include<iostream> using namespace std; int main() { int n; cin>>n;//这是一个注释 return 0; }

            • -2
              @ 2023-8-18 18:14:19

              #include<iostream> using namespace std; int main() { int n; cin>>n;//这是一个注释 return 0; }

              • -2
                @ 2023-8-9 9:47:03
                #include <iostream>
                using namespace std;
                int main()
                {
                    int t, k;  
                    cin >> t >> k;
                    if ((t == 1 && k == 2) || (t == 2 && k == 3) || (t == 3 && k == 1))
                        cout << "win";
                    else if (t == k)
                        cout << "tie";
                    else
                        cout << "lose";
                    return 0;
                }
                

                点赞哦 讨论里也有

                • -2
                  @ 2023-7-9 18:42:17

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

                  • -2
                    @ 2023-6-17 18:34:12
                    #include <bits/stdc++.h>
                    using namespace std;
                    int t,k;
                    int main()
                    {
                        cin>>t>>k;
                        if (t==k)
                        {
                            cout<<"tie";
                        }
                        else if (t==1 && k==2 || t==2 && k==3 || t==3 && k==1)
                        {
                            cout<<"win";
                        }
                        else
                        {
                            cout<<"lose";
                        }
                        return 0;
                    }
                    666666666666666666666666666666666666666666
                    
                    • -2
                      @ 2023-5-1 14:29:27

                      用a,b分别表示两个人,再列出可能出现的几种情况 #include <iostream> using namespace std; int main() { int a,b; cin >> a >> b; if (a == b) { cout << "tie"; } else if (a == 1) { if (b == 2) { cout << "win"; } else if (b == 3) { cout << "lose"; } } else if (a == 2) { if (b == 3) { cout << "win"; } else if (b == 1) { cout << "lose"; } } else if (a == 3) { if (b == 1) { cout << "win"; } else if (b == 2) { cout << "lose"; } } return 0; }

                      • -2
                        @ 2023-4-28 18:17:37
                        #include <iostream>
                        using namespace std;
                        int main()
                        {
                            int a , b;
                            cin >> a >> b;
                            if(a==1 && b==2)
                            {
                                cout << "win";
                            }
                            if(a==1 && b==3)
                            {
                                cout << "lose";
                            }
                            if(a==2 && b==1)
                            {
                                cout << "lose";
                            }
                            if(a==2 && b==3)
                            {
                                cout << "win";
                            }
                            if(a==3 && b==1)
                            {
                                cout << "win";
                            }
                            if(a==3 && b==2)
                            {
                                cout << "lose";
                            }
                            else
                            {
                                cout << "tie";
                            }
                        }
                        
                        • -2
                          @ 2023-3-29 19:38:48

                          分别判断赢、平和输三种情况

                          #include<bits/stdc++.h>
                          using namespace std;
                          int main()
                          {
                              int x,y;
                              cin>>x>>y;
                              if ((x==1&&y==2)||(x==2&&y==3)||(x==3&y==1))
                                  cout<<"win";
                              else if (x==y)
                                  cout<<"tie";
                              else
                                  cout<<"lose";
                              return 0;
                          }
                          
                          • -2
                            @ 2022-10-3 17:55:43
                            #include <iostream>
                            using namespace std;🚀️ 🚀️ 
                            int main()
                            {
                            	int a,b;
                            	cin >> a >> b;
                            	if (a == b)
                            	{
                            		cout << "tie";
                            	}
                            	else if (a == 1)
                            	{
                            		if (b == 2)
                            		{
                            			cout << "win";
                            		}
                            		else if (b == 3)
                            		{
                            			cout << "lose";
                            		}
                            	}
                            	else if (a == 2)
                            	{
                            		if (b == 3)
                            		{
                            			cout << "win";
                            		}
                            		else if (b == 1)
                            		{
                            			cout << "lose";
                            		}
                            	}
                            	else if (a == 3)
                            	{
                            		if (b == 1)
                            		{
                            			cout << "win";
                            		}
                            		else if (b == 2)
                            		{
                            			cout << "lose";
                            		}
                            	}
                            	return 0;
                            }**~~**~~**
                            
                          • -2
                            @ 2022-8-29 20:36:40
                            #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";
                                else cout<<"lose";
                                return 0;
                            }
                            

                            最简代码

                            • -2
                              @ 2022-8-10 21:06:55

                              这估计是本题最短的AC代码了吧,来吧,不废话了,这一道题的话考的是分支问题(可以看标签)那我们就老老实实用 if - else if - else 来做,先列举出三种情况

                              a == b // ①两个值相等,平局,输出tie
                              a == 1 && b == 2 || a == 2 && b == 3 || a == 3 && b == 1 // ②判断每个的克星,输出小T赢的情况
                              else cout << "lose"; // ③最后剩下的就是小K赢了
                              

                              废话少说,上代码!

                              #include <bits/stdc++.h>
                              using namespace std;
                              int main()
                              {
                                  int a, b;
                                  cin >> a >> b;
                                  if (a == b) cout << "tie";
                                  else if (a == 1 && b == 2 || a == 2 && b == 3 || a == 3 && b == 1) cout << "win";
                                  else cout << "lose";
                                  return 0;
                              }
                              
                            • -3
                              @ 2023-10-5 20:13:44

                              #include <iostream> using namespace std; int main() { int t, k; cin >> t >> k; if ((t == 1 && k == 2) || (t == 2 && k == 3) || (t == 3 && k == 1)) cout << "win"; else if (t == k) cout << "tie"; else cout << "lose"; return 0; }

                              • -3
                                @ 2023-9-23 17:24:02
                                #include <bits/stdc++.h>
                                using namespace std;
                                int main(){
                                    int a,b;
                                    cin>>a>>b;
                                    if (a==b){
                                        cout<<"tie";
                                    }
                                    if ((a==2 and b==3) or (a==1 and b==2) or (a==1 and b==3)){
                                        cout<<"win";
                                    }
                                    else{
                                        cout<<"lose";
                                    }
                                }
                                
                                • -3
                                  @ 2023-9-3 18:59:12
                                  #include<bits/stdc++.h> //1代表石头 2代表剪刀 3代表布 
                                  using namespace std;
                                  int main(){
                                  	int a,b;
                                  	a<=3;
                                  	b<=3;
                                  	cin>>a>>b;
                                  	if(a==1&&b==2){
                                  		cout<<"win";
                                  	}if(a==2&&b==2){
                                  		cout<<"tie";
                                  	}if(a==3&&b==2){
                                  		cout<<"lose";
                                  	}if(a==1&&b==1){
                                  		cout<<"tie";
                                  	}if(a==2&&b==1){
                                  		cout<<"lose";
                                  	}if(a==3&&b==1){
                                  		cout<<"win";
                                  	}if(a==1&&b==3){
                                  		cout<<"lose";
                                  	}if(a==2&&b==3){
                                  		cout<<"win";
                                  	}if(a==3&&b==3){
                                  		cout<<"tie";
                                  	}
                                  	return 0;
                                  }
                                  
                                  • -3
                                    @ 2023-8-30 12:53:11
                                    //挑战全网最简代码,不信你就试试看
                                    #include <iostream>
                                    using namespace std;
                                    int main()
                                    {
                                        cout << "lose";
                                        return 0;
                                    }
                                    
                                    • @ 2023-9-3 12:43:16

                                      我好像明白了,测试样例就是输的

                                  信息

                                  ID
                                  43
                                  时间
                                  1000ms
                                  内存
                                  16MiB
                                  难度
                                  3
                                  标签
                                  递交数
                                  3937
                                  已通过
                                  2031
                                  上传者