Untitled

mail@pastecode.io avatar
unknown
c_cpp
2 months ago
492 B
0
Indexable
Never
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
const string name = "Asd.txt";
void chi(int mas[], int mac[], int size)
{
	ifstream c(name);
	c >> size;
	for (int i = 0; i < size; i++)
	{
		c >> mas[i] >> mac[i];
	}
}
void kol(int& a)
{
	ifstream c(name);
	c >> a;
	c.close();
}
int main()
{
	int a;
	kol(a);
	int mas[122], mac[122];
	chi(mas, mac, a);
	for (int i = 0; i < a; i++)
	{
		cout << mas[i] << " " << mac[i] << endl;
	}
}
Leave a Comment