Advertisement
Spocoman

Savings

Oct 7th, 2023
830
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7.     double salary;
  8.     cin >> salary;
  9.  
  10.     int months;
  11.     cin >> months;
  12.  
  13.     double minimalCosts;
  14.     cin >> minimalCosts;
  15.  
  16.     double monthlySavings = salary * 0.70 - minimalCosts;
  17.  
  18.     printf("She can save %.2f%%\n%.2f", monthlySavings / salary * 100, monthlySavings * months);
  19.  
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement