Created
February 9, 2012 11:12
-
-
Save hhc0null/1779341 to your computer and use it in GitHub Desktop.
aoj-0007-Debt_Hell.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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