Advertisement
mfgnik

Untitled

Jun 2nd, 2020
840
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. int main() {
  5.     int percents_amt, rubles_amt, cents_amt, years, res;
  6.     std::cin >> percents_amt >> rubles_amt >> cents_amt >> years;
  7.     res = rubles_amt * 100 + cents_amt;
  8.     while (years--) {
  9.         res += res * percents_amt / 100;
  10.     }
  11.     std::cout << res / 100 << " " << res % 100;
  12.     return 0;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement