Untitled

mail@pastecode.io avatar
unknown
c_cpp
2 months ago
287 B
0
Indexable
Never
#include <iostream>
#include <fstream>

using namespace std;

const string filename = "input.txt";

void read(int& a) {
	ifstream in(filename);
	if (!in.is_open()) {
		cout << "error"; return;
	}
	in >> a;
	in.close();
}

int main()
{
	int a;
	read(a);
	cout << a;
}
Leave a Comment