top1编程
← 返回题目
题解

【入门】淘淘的零花钱

1 条题解

  • 0
    @ 2026-7-29 0:17:07
    #include <iostream>
    using namespace std;
    
    int main() {
        int n;
        cin >> n;
        
        int tens = n / 10;
        int units = n % 10;
        
        int taotao_money = units * 10 + tens;
        
        // 确保输出是两位数(如果units是0,则十位是0,但整数会省略前导零)
        // 因此可能需要特殊处理,但根据样例,直接输出整数即可
        cout << taotao_money << endl;
        
        return 0;
    }
    
    • 1