All pastes #1897684 Raw Edit

How To Get Rich On A 1-Cent Week

public cpp v1 · immutable
#1897684 ·published 2010-07-10 05:21 UTC
rendered paste body
#include <iostream>using namespace std;int main (){  int payment2;  int payment = 1;  int profit = 1;  int weeks = 1;// these are initialized to accomodate the first week.  do  {    payment2 = payment * 2;    payment = payment2;    profit = profit + payment;    weeks++;  } while (profit < 100000000); // 100,000,000 cents = $1,000,000  cout << "In " << weeks << " weeks, I will be a millionaire!";  return 0;}