Skip to content

Instantly share code, notes, and snippets.

@hhc0null
Created February 9, 2012 11:12
Show Gist options
  • Save hhc0null/1779341 to your computer and use it in GitHub Desktop.
Save hhc0null/1779341 to your computer and use it in GitHub Desktop.
aoj-0007-Debt_Hell.cpp
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <stack>
using namespace std;
int main() {
int week, tmp, rep = 100000;
cin >> week;
for(int i = 0; i < week; i++) {
rep += rep * 0.05;
tmp = 0;
tmp = rep % 1000;
rep -= tmp;
if(tmp) rep += 1000;
}
cout << rep << endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment