正在加载图片...
17格式化输出 1.用setw操作符为输出数据项指定宽度(仅对一项有效) int intvalue=3928 float floatvalue=91.5 char cstring Value[="Confucius mo-tse; cout <<"C<< setw(5)<< intValue <<")<<endl cout <<C<< setw(8)<<floatvalue < )<<endl cout <<"C<< setw(20)<< cString Value < )<<endl i 见1-10.cpp12 1.7 格式化输出 1. 用setw操作符为输出数据项指定宽度(仅对一项有效): int intValue = 3928 ; float floatValue = 91.5 ; char cStringValue[ ] = " Confucius & Mo-tse" ; cout << "(" << setw(5) << intValue << ")" << endl ; cout << "(" << setw(8) << floatValue << ")" << endl ; cout << "(" << setw(20) << cStringValue << ")" << endl ; 见1-10.cpp
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有