Skip to content

Instantly share code, notes, and snippets.

@flashlib
Created June 21, 2013 08:47
Show Gist options
  • Save flashlib/5829830 to your computer and use it in GitHub Desktop.
Save flashlib/5829830 to your computer and use it in GitHub Desktop.
设置cout补0
#include<iostream.h>
void main()
{
int num;
num=5;
cout.fill('0');//设置填充字符
cout.width(5);//设置域宽
cout<<num<<endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment