2 条题解

  • 0
    @ 2026-7-2 14:04:58

    #include using namespace std;

    int main() { int a; cin >> a; cout << a / 1000 + a % 1000 / 100 * 10 + a % 100 / 10 * 100 + a % 10 * 1000;

    return 0;
    

    }

    • -1
      @ 2026-6-6 17:19:46
      #include <iostream>
      using namespace std;
      
      int main()
      {
          int x;
          cin >> x;
          int a = x / 1000;      // 千位
          int b = x / 100 % 10;  // 百位
          int c = x / 10 % 10;   // 十位
          int d = x % 10;        // 个位
          int res = d*1000 + c*100 + b*10 + a;
          cout << res;
          return 0;
      }
      • 1

      【入门】倒序输出一个四位整数

      信息

      ID
      30033
      时间
      1000ms
      内存
      256MiB
      难度
      2
      标签
      递交数
      107
      已通过
      62
      上传者