#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
char str[1000];
sprintf(str,"%.100lf",(double)1/250);
cout<<str;
}
运行这个程序得到的结果是
0.004000000000000000000000000000000中间有一段非零数字
00000000000000000000
#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
char str[1000];
sprintf(str,"%.100lf",(double)1/250);
cout<<str;
}
运行这个程序得到的结果是
0.004000000000000000000000000000000中间有一段非零数字
00000000000000000000