题目:一年约3.156X10 ^ 7秒,编写程序,输入年龄,输出相应秒数。
分析:需用到函数pow()
#include <stdio.h>
#include <math.h>
int main()
{
float age;
printf("输入年龄\n");
scanf("%f", &age);
printf("%.2f秒", age*3.156*pow(10,7));
return 0;
}
题目:一年约3.156X10 ^ 7秒,编写程序,输入年龄,输出相应秒数。
分析:需用到函数pow()
#include <stdio.h>
#include <math.h>
int main()
{
float age;
printf("输入年龄\n");
scanf("%f", &age);
printf("%.2f秒", age*3.156*pow(10,7));
return 0;
}