Created
June 21, 2013 08:47
-
-
Save flashlib/5829830 to your computer and use it in GitHub Desktop.
设置cout补0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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