Advertisement
Guest User

Discounts on the Prices V2

a guest
Dec 8th, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.32 KB | None | 0 0
  1. //Discounts on the Prices V2
  2. //by: Cyb3rDoctor
  3. #include<iostream>
  4. #include<iomanip>
  5. using namespace std;
  6. int main() {
  7.  
  8. double n,price=0,sum=0;
  9.  
  10. cin>>n;
  11.  
  12. for (int i=1 ; i<=n ; i++)
  13. {
  14.     cin>>price;
  15.    
  16.     if (price>=10)
  17.     sum=sum+price*0.15;
  18.  
  19. }
  20.  
  21. cout<<"the total amount of money lost = "<<sum;
  22.  
  23. return 0; }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement