Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

纠错:错别字 #151

Merged
merged 1 commit into from
Aug 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ gcc -o 5-5 5-5.c -lm

#### 程序分析

1. 在 `scanf` 函数中,格式声明为 "%lf",表示输入的是双精度型实数。从上面的运行结果来看输入 “1 3 2” 时,两个数字之间是用空格分开,如果用其他符号(如逗号)会出错。我们输入的 “1 3 2” 虽然是整数,但是由于指定了用 `%lf` 的格式输入,因此系统会先把这 3 个整数装换成为实数 1.0,3.0,2.0,然后赋值给变量 a,b,c。
1. 在 `scanf` 函数中,格式声明为 "%lf",表示输入的是双精度型实数。从上面的运行结果来看输入 “1 3 2” 时,两个数字之间是用空格分开,如果用其他符号(如逗号)会出错。我们输入的 “1 3 2” 虽然是整数,但是由于指定了用 `%lf` 的格式输入,因此系统会先把这 3 个整数转换成为实数 1.0,3.0,2.0,然后赋值给变量 a,b,c。

2. 在 `printf` 函数中,不是简单地用 "%f" 格式声明,而是在格式符 "f" 的前面加了 “7.2”。表示的意思是在输出 x1,x2 时,指定数据占 7 列,其中小数占 2 列。这样做有两个好处。

Expand Down
Loading