floats.c
This commit is contained in:
parent
11e99475eb
commit
cd24bbb820
19
c04_string/floats.c
Normal file
19
c04_string/floats.c
Normal file
@ -0,0 +1,19 @@
|
||||
/* floats.c - 一些浮点型修饰符的组合 */
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
const double RENT = 3852.99; // const变量(只读变量,不是常量)
|
||||
|
||||
printf("*%f*\n", RENT);
|
||||
printf("*%e*\n", RENT);
|
||||
printf("*%4.2f*\n", RENT);
|
||||
printf("*%3.1f*\n", RENT);
|
||||
printf("*%10.3f*\n", RENT);
|
||||
printf("*%10.3E*\n", RENT);
|
||||
printf("*%+4.2f*\n", RENT);
|
||||
printf("*%+10.2f*\n", RENT);
|
||||
printf("*%010.2f*\n", RENT);
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user