正在加载图片...
17格式化输出 2.用 I setprecision操作符输出数的有效位数对多项有效) float quotient, number=132.364f, number2=2691f quotient =number/number2 cout < quotient < endl cout < setprecision(5)<< quotient < endl cout < setprecision(4)<< quotient < end cout < setprecision 3)<<quotient < endl cout < quotient < endl cout < setprecision (2)<< quotient < end cout < setprecision (1)<< quotient < end 见1-1cp13 1.7 格式化输出 2. 用setprecision操作符输出数的有效位数(对多项有效) 。 float quotient , number1 = 132.364f , number2 = 26.91f ; quotient = number1 / number2 ; cout << quotient << endl ; cout << setprecision (5) << quotient << endl ; cout << setprecision (4) << quotient << endl ; cout << setprecision (3) << quotient << endl ; cout << quotient << endl ; cout << setprecision (2) << quotient << endl ; cout << setprecision (1) << quotient << endl ; 见1-11.cpp
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有