#include <iostream>
#include <fstream>
using namespace std;
int main() {
ifstream file("input.txt", ios::in);
int a[1000][7];
int num = 0;
if (file.is_open() == false) {
cerr << "Error!" << endl;
exit(-1);
}
while (file >> a[num][0]) {
for (int i = 1; i < 7; i++) {
file >> a[num][i];
}
num++;
}
cout << "Total " << num << " line of data" << endl;
file.close();
return 0;
}
温馨提示:内容为网友见解,仅供参考