5 条题解

  • 2
    @ 2025-1-26 20:30:00

    这题可以使用setw()函数。

    #include <iostream>
    #include <iomanip>
    using namespace std;
    int main()
    {
      int a, b, c;
      cin >> a >> b >> c;
      cout << setw(8) << a << " " << setw(8) << " " << setw(8) << b << " " << setw(8) << c << endl;
      return 0;
    }
    

    也可以使用printf()函数。

    #include <cstdio>
    int main()
    {
      int a, b, c;
      scanf("%d %d %d", &a, &b, &c);
      printf("%8d %8d %8d\n", a, b, c);
      return 0;
    }

    信息

    ID
    4454
    时间
    1000ms
    内存
    128MiB
    难度
    1
    标签
    (无)
    递交数
    759
    已通过
    269
    上传者