Advertisement
Avdluna

URI 1038

May 22nd, 2015
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.63 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6.     int cod,qtd;
  7.     float x;
  8.  
  9.     scanf("%d %d", &cod, &qtd);
  10.  
  11.     if(cod==1){
  12.  
  13.         x = qtd*4.00;
  14.  
  15.         printf("Total: R$ %.2f\n", x);
  16.     }
  17.  
  18.     else if(cod==2){
  19.  
  20.         x = qtd*4.50;
  21.  
  22.         printf("Total: R$ %.2f\n", x);
  23.     }
  24.  
  25.     else if(cod==3){
  26.  
  27.         x = qtd*5.00;
  28.  
  29.         printf("Total: R$ %.2f\n", x);
  30.     }
  31.  
  32.     else if(cod==4){
  33.  
  34.         x = qtd*2.00;
  35.  
  36.         printf("Total: R$ %.2f\n", x);
  37.     }
  38.  
  39.     else if(cod==5){
  40.  
  41.         x = qtd*1.50;
  42.  
  43.         printf("Total: R$ %.2f\n", x);
  44.     }
  45.     return 0;
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement