2 条题解

  • 0
    @ 2026-7-4 14:38:31
    #include <iostream>
    using namespace std;
    
    int main() {
    	int t, k;
    	cin >> t >> k;
    	if (t == k) {
    		cout << "tie" << endl;
    	} else if ((t == 1 && k == 2) || (t == 2 && k == 3) || (t == 3 && k == 1)) {
    		cout << "win" << endl;
    	} else {
    		cout << "lose" << endl;
    	}
    	return 0;
    }
    
    
    
    • 0
      @ 2026-6-12 20:23:39

      怎么做,教教我?<_>

      • @ 2026-6-20 16:57:30

        #include <bits/stdc++.h>

        using namespace std;

        int main() { int t, k; // t代表小T按的数字,k代表小K按的数字

        // 读入两个数字
        cin >> t >> k;
        
        // 1. 判断是否平局
        if (t == k) {
            cout << "tie" << endl;
        } 
        // 2. 判断小T获胜的所有情况
        else if ((t == 1 && k == 2) || (t == 2 && k == 3) || (t == 3 && k == 1)) {
            cout << "win" << endl;
        } 
        // 3. 其余情况均为小T失败
        else {
            cout << "lose" << endl;
        }
        
        return 0;
        

        }

    • 1

    信息

    ID
    30054
    时间
    1000ms
    内存
    256MiB
    难度
    2
    标签
    递交数
    42
    已通过
    28
    上传者