#include<iostream>
#include<fstream>
using namespace std;
int main ()
{
fstream infile("data.txt");
double a = 0.0 ,b= 0.0,c = 0.0;
if(!infile)
{
cout<<"Unable to open the file !";
return 1;
}
infile>>a;
infile>>b;
infile>>c;
cout<<a<<endl;
cout<<b<<endl;
cout<<c<<endl;
return 0;
}
c++读取文件中的浮点数
最新推荐文章于 2025-06-02 14:55:04 发布