格式化输出

格式化输出
double a; C语言 C++ 
位数指定为n

 printf("%nf",a);

cout.sef(ios::shopoint);

cout.position(n);

小数点后指定n位

printf("%.nf",a);

cout.sef(ios::fixed);

cout.sef(ios::shopoint);

cout.position(n);
posted @ 2012-05-04 22:23  无殇天下  阅读(119)  评论(0)    收藏  举报