#include <iostream>
#include<iomanip>
using namespace std;
int main()
{
int a;
cin>>a;
cout<<setw(3)<<setfill('0')<<a<<endl;
return 0;
}
cout 输出指定位数,不足补0
最新推荐文章于 2023-08-05 07:39:12 发布
#include <iostream>
#include<iomanip>
using namespace std;
int main()
{
int a;
cin>>a;
cout<<setw(3)<<setfill('0')<<a<<endl;
return 0;
}