Untitled
unknown
c_cpp
2 years ago
381 B
7
Indexable
#include <iostream>
#include <fstream>
using namespace std;
const string filename = "input.txt";
void read(int& n) {
ifstream in(filename);
if (!in.is_open()) {
cout << "error"; return;
}
int a;
in >> n;
for (int i = 0; i < n; i++)
{
in >> a;
cout << a << endl;
}
in.close();
}
int main()
{
int n;
int a;
read(n);
//cout << n;
}Editor is loading...
Leave a Comment