You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
420 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#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;
}