#include<iostream>
#include<fstream>
using namespace std;
int main() {
int a[10];
ofstream outfile("mui.txt", ios::out);
if (!outfile) {
cerr << "open error!" << endl; exit(1);
return -1;
}
int i, j;
for (i = 1; i < 10; i++) {
for (j = i; j < 10; j++) {
outfile << i << "*" << j << "=" << i * j << "\t";
cout << i << "*" << j << "=" << i * j << "\t";
}
outfile << "\n";
cout << '\n';
}
outfile.close();
ifstream infile("mu2.txt", ios::in);
if (!infile) {
cerr << "open error!" << endl;
return -1;
}
for (i = 0; i < 10; i++) {
infile >> a[i];
cout << a[i] << " ";
}
infile.close();
system("pause");
}
#include<fstream>
using namespace std;
int main() {
int a[10];
ofstream outfile("mui.txt", ios::out);
if (!outfile) {
cerr << "open error!" << endl; exit(1);
return -1;
}
int i, j;
for (i = 1; i < 10; i++) {
for (j = i; j < 10; j++) {
outfile << i << "*" << j << "=" << i * j << "\t";
cout << i << "*" << j << "=" << i * j << "\t";
}
outfile << "\n";
cout << '\n';
}
outfile.close();
ifstream infile("mu2.txt", ios::in);
if (!infile) {
cerr << "open error!" << endl;
return -1;
}
for (i = 0; i < 10; i++) {
infile >> a[i];
cout << a[i] << " ";
}
infile.close();
system("pause");
}