|
|
|
|
复制本帖HTML代码
|
高亮:
今天贴
X 昨天贴
X 前天贴
X |
What is your problem?
Do you want the output to be like this:(suppose tax=0.053)
--------------------------------Tax--------------0.05
?
//Before Tax 32 blanks and after Tax 14 blanks.
I think you might not be able to get 0.05, right?
This is because setprecision() should be used together
with "showpoint" or "fixed".
You can try this:
cout << "\t\t\t\t" << setiosflags(ios:left) << setw(17)
<< "Tax" << setiosflags(ios:fixed) << setprecision(2)
<< tax << endl << endl;
.
|
欢迎来到华新中文网,踊跃发帖是支持我们的最好方法! |
Put your OWN COOL signature here!
|
|