浮点数保留两位小数

来源:互联网 发布:淘宝军刀 编辑:程序博客网 时间:2024/05/16 23:58

#include<cstdio>
int main()
{
float f1=0.9876;
printf("%.2f",f1);
return 0; 
}

0 0
原创粉丝点击