输入输出乘法口诀!
#include<iostream>
#include<fstream>
#include<string>
using namespace std;
void Cf()
{
ofstream of("cf.txt");
for(int i=1;i<10;i++)
{
for(int j=1;j<=i;j++)
{
of << i << "*" << j << "=" << i*j << " ";
}
of << endl;
}
}
int main()
{
Cf();
ifstream infile("in.txt");
ofstream outfile("out.txt");
if(!infile)
{
cerr <<"error file";
return -1;
}
if(!outfile)
{
cerr <<"write error";
return -1;
}
string word;
while(infile >> word)
{
cout << word << endl;
outfile << word << endl;
}
return 0;
}