Advertisement
alaminrifat

URI -1038 with C++

Apr 11th, 2020
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | None | 0 0
  1. #include<iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int x;
  8.     float y,sum=0;
  9.     cin>>x>>y;
  10.     if(x==1)
  11.         sum = 4.00 * y;
  12.     if(x==2)
  13.         sum = 4.50 * y;
  14.     if(x==3)
  15.         sum = 5.00 * y;
  16.     if(x==4)
  17.         sum = 2.00 * y;
  18.     if(x==5)
  19.         sum = 1.50 * y;
  20.  
  21.    cout.precision(2);
  22.     cout<<"Total: R$ "<<fixed<<sum<<endl;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement