SHARE
TWEET

Untitled

mfgnik Jun 2nd, 2020 747 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. int main() {
  5.     float percents_amt, rubles_amt, cents_amt, years, res, cnt = 0;
  6.     std::cin >> percents_amt >> rubles_amt >> cents_amt >> years;
  7.     res = rubles_amt * 100 + cents_amt;
  8.     while (cnt < years) {
  9.         res += res * percents_amt / 100;
  10.         res = trunc(res);
  11.         cnt += 1;
  12.     }
  13.     std::cout << int(res) / 100 << " " << int(res) % 100;
  14.     return 0;
  15. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top