的测 If this is the case, you have to write a conversion function yourself. in C, you use printf("%.0f",a) to generate the result. This is the same as setprecision.
【在 B********e 的大作中提到】 : : 的测 : If this is the case, you have to write a conversion function yourself. : in C, you use printf("%.0f",a) to generate the result. This is the same as : setprecision.
t*t
9 楼
use setprecision(0), obviously not setprecision(1) the default precision is 6, so you must set it to summerize, you need cout< 的测
【在 t****t 的大作中提到】 : use setprecision(0), obviously not setprecision(1) : the default precision is 6, so you must set it : to summerize, you need : cout<: : 的测
dude. 3.14 will print like 3. For flexibility, write your own function.
【在 w***g 的大作中提到】 : 还是thrust老大牛
t*t
14 楼
well, you have to specify a precision for every number, don't you? 3.14 can't even be represented in finite precision anyway, so given 3.14, the computer don't know it's 3.14 or 3.140 or 3.1400. *you* have to tell the computer to print how many digits. Unless you say, "keep all trailing non-zero but omit zero, up to so many digits", but none of the standard library in any language (to the best of my knowledge) will give you this, you have to write your own function.
【在 B********e 的大作中提到】 : dude. 3.14 will print like 3. : For flexibility, write your own function.