23 条题解
-
-5
-
-11
保留 x 位小数
方法 1
- 头文件:
#include <cstdio>
- 语句:
printf("%.xf", a);
方法 2
- 头文件:
#include<iostream>
、#include<iomanip>
- 语句:
cout << fixed << setprecision(x) << a;
注意
如果题目说保留 x 位小数,那么就按照这种方式输出就可以了。
#include<iostream> #include<iomanip> using namespace std; int main() { double a=3.14159265857; cout << fixed << setprecision(x) << a; x代表具体要保留几位。 请务必自己多敲几遍代码,这个单词比较长避免考场出到原题自己单词忘了 }
#include<iostream> #include <cstdio> using namespace std; int main() { double a=3.14159265857; printf("%.xf", a); x代表具体要保留几位。 请务必自己多敲几遍代码,这个单词比较长避免考场出到原题自己单词忘了 }
-
hetao342043@hetao101.com @ 2022-7-7 23:12:31
................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. ................................................................................................................................................................. .................................................................................................................................................................
-
hetao794786 @ 2022-8-12 22:05:13
@张文昊 (hetao342043@hetao101.com) 请不要刷屏,如果不喜欢他人的题解,也请不要刷屏,要维护秩序,谢谢
-
hetao794786 @ 2022-8-12 22:05:48
@张文昊 (hetao342043@hetao101.com) 况且人家是 SU!超级管理员!
-
hetao2940092 @ 2022-8-29 12:43:10
-
hetao2940092 @ 2022-8-29 12:46:14
SU
-
hetao4050712 @ 2023-2-26 15:20:59
老师,没学过printf怎么办?😕 【忠诚】【忠诚】
-
hetao4565091 @ 2023-5-12 12:58:07
张文昊 (hetao342043@hetao101.com) 请不要刷屏
-
hetao4565091 @ 2023-5-12 12:58:33
@张文昊 (hetao342043@hetao101.com) 请不要刷屏
-
hetao842180 @ 2024-1-24 12:38:02
SU 是Super Administrator的缩写!!!
-
hetao36337224 @ 2024-2-5 17:47:22
- 头文件: