I just made a program to output the number one googleplex, but its such a huge number (2.57 MB) that windows cuts off a large chunk of the top of it, so now I need to modify it to print to a .txt file. How would I go about doing this?
//I want 1 followed by this many zeroes: 1000000000000000000000000000000000000000 0000000000000000000000000000000000000000 000000000000000000000
//100000 * 100000 * 100000 * 100000 * 100000 * 100000 * 100000 * 100000 * 100000 * 100000 * 100000 * 100000 * 100000 * 100000 * 100000 * 100000 * 100000 * 100000 * 100000 * 100000
//I want 1 followed by this many zeroes: 1000000000000000000000000000000000000000
//100000 * 100000 * 100000 * 100000 * 100000 * 100000 * 100000 * 100000 * 100000 * 100000 * 100000 * 100000 * 100000 * 100000 * 100000 * 100000 * 100000 * 100000 * 100000 * 100000
#include <iostream>
using namespace std;
int print(int thr,int until);
int main() {
int threes=0;
int power=0;
cout << "I now present to you.. a googolplex!\n\n";
while(power<20) {
print(threes, 100000);
power++;
}
cout << "\n\nDONE!\n";
for(;;);
}
int print(int thr,int until) {
int repetitions=0;
while (repetitions<until) {
cout << "0";
thr++;
if(thr>=3) {
cout << ",";
thr=0;
}
repetitions++;
}
return thr;
} 