Files
python/RuMenJingDian/Others/FillBlank.cpp

14 lines
433 B
C++
Raw Normal View History

2025-08-30 18:35:01 +08:00
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false); //读入输出优化的强迫症
// 输出宽度10个字符,左对齐,不足补空格,输出3
cout << setw(10) << setfill(' ') << left << 3;
cout << "i am huanghai!" << endl;
// 输出宽度5,右对齐,不足补0,输出10
cout << setw(5) << setfill('0') << right << 10 << endl;
return 0;
}