Advertisement
Spocoman

03. Deposit Calculator

Aug 31st, 2023 (edited)
562
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.59 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.     double sum;
  7.     cin >> sum;
  8.  
  9.     int months;
  10.     cin >> months;
  11.  
  12.     double annualPercentage;
  13.     cin >> annualPercentage;
  14.  
  15.     double total = sum + sum * months * annualPercentage / 1200;
  16.  
  17.     cout << total << endl;
  18.  
  19.     return 0;
  20. }
  21.  
  22. Или леко тарикатската:)
  23.  
  24. #include <iostream>
  25.  
  26. using namespace std;
  27.  
  28. int main() {
  29.     double sum, months, annualPercentage;
  30.     cin >> sum >> months >> annualPercentage;
  31.  
  32.     cout << sum + sum * months * annualPercentage / 1200 << endl;
  33.  
  34.     return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement