输入输出c++


int readFile()
{
	ifstream inFile("input.txt");
	
	if (!inFile.is_open()) {
		cout << "infile opening error";
		return 1;
	}
    
	int  i = 0;
	while (!inFile.eof()) {
		inFile >> a[i++];
	}
	n=i;
	inFile.close();

}

void writeFile(int nn,int nnn)
{

	ofstream outFile("output.txt");
	outFile << nn << endl ;
	outFile << nnn << endl ;
    outFile.close();
}

你可能感兴趣的:(C++)