【Luogu2394】yyy loves Chemistry I(浮点数精度)

problem

  • 给你一个很长的浮点,输出他除以23保留8位小数。
  • 文件小于5MB。

solution

各种类型浮点数的精度:
float:6~7位;
double:15~16位;
long double:18~19位。

codes

#include<cstdio>
int main(){
    long double x;
    scanf("%15Lf",&x);//强制提高精度
    printf("%.8Lf",x/23);//输出保留8位小数
    return 0;
}
posted @ 2018-07-28 15:05  gwj1139177410  阅读(174)  评论(0编辑  收藏  举报
选择