版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
#include <iostream>
#include <fstream>
using namespace std;
const int ROW = 27;
const int VOL = 30;
int main(){
double d[ROW][VOL];
ifstream in("D:\\data.txt");//打开文件
//读数据。。
for(int i = 0; i < ROW; ++i){
for(int j = 0; j < VOL; ++j){
in >> d[i][j];
}
}
in.close();//关闭文件
//输出结果
for(int i = 0; i < ROW; ++i){
for(int j = 0; j < VOL; ++j){
cout<<d[i][j]<<" ";
}
cout<<endl;
}
return 0;
}