problem
- 给你一个很长的浮点,输出他除以23保留8位小数。
- 文件小于5MB。
solution
各种类型浮点数的精度:
float:6~7位;
double:15~16位;
long double:18~19位。
codes
#include
int main(){
long double x;
scanf("%15Lf",&x);//强制提高精度
printf("%.8Lf",x/23);//输出保留8位小数
return 0;
}
各种类型浮点数的精度:
float:6~7位;
double:15~16位;
long double:18~19位。
#include
int main(){
long double x;
scanf("%15Lf",&x);//强制提高精度
printf("%.8Lf",x/23);//输出保留8位小数
return 0;
}
转载于:https://www.cnblogs.com/gwj1314/p/9444608.html