Advertisement
Guest User

Untitled

a guest
Feb 13th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<math.h>
  3. int main()
  4.  
  5. {
  6.  
  7. int x,y;
  8.  
  9. scanf("%d %d",&x,&y);
  10.  
  11. double res1=4.00*y;
  12. double res2=4.50*y;
  13. double res3=5.00*y;
  14. double res4=2.00*y;
  15. double res5=1.50*y;
  16.  
  17. if(x==1){
  18.  
  19. printf("Total: R$ %.2lf\n",res1);
  20.  
  21. }
  22.  
  23. else if(x==2){
  24.  
  25. printf("Total: R$ %.2lf\n",res2);
  26. }
  27.  
  28. else if(x==3){
  29.  
  30. printf("Total: R$ %.2lf\n",res3);
  31. }
  32.  
  33. else if(x==4){
  34.  
  35. printf("Total: R$ %.2lf\n",res4);
  36. }
  37.  
  38. else{
  39.  
  40. printf("Total: R$ .2lf\n",res5);
  41. }
  42.  
  43. return 0;
  44.  
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement