Source:
#include <iostream>
using namespace std;
int main ()
{
int x, y;
cin >> x >> y;
freopen("c:\\test.txt", "w", stdout);
if (y == 0)
cerr<<"error."<<endl;
else
cout << x << "/" << y << "=" << x / y << endl;
system("pause");
return 0;
}
operation result:
Input: 93
Generating a text file on the disc c test.txt, content: 9/3 = 3