示例
#include <stdio.h>
int main(void)
{
int i = 1;
float f = 2;
float f1 = 2.13145;
float f2 = 3.16E7;//3.16乘10的7次方
float f3 = 7.00;
float f4 = 2e-8;
printf("i=%d, f=%f, f1=%.2f \n", i, f, f1);
printf("f2=%f \n", f2);
printf("f4=%f \n", f4);
float weight;
int age;
scanf_s("%f %d", &weight, &age);
printf("weight=%0.2f, age=%d", weight, age);
getchar();
getchar();
getchar();
getchar();
return 0;
}
运行