C++ 运行结果保存到文本中
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main() {
ofstream out("output.txt");
for (int i = 1; i < 100; ++i) {
for (int j = 1; j <= i; ++j) {
out << i << "x" << j << "=" << i * j<<"\t";
}
cout << endl;
}
out.close();
return 0;
}
posted on 2020-04-10 10:55 Indian_Mysore 阅读(587) 评论(0) 收藏 举报
浙公网安备 33010602011771号