Advertisement
shamiul93

1134

Jan 30th, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.37 KB | None | 0 0
  1.  
  2. #include<stdio.h>
  3.  
  4. main()
  5. {
  6.     int alc=0,gas=0,dis=0,x;
  7.  
  8.     while(scanf("%d",&x))
  9.     {
  10.         if(x==1)
  11.            alc++;
  12.         else if(x==2)
  13.            gas++;
  14.         else if(x==3)
  15.             dis++;
  16.         else if(x==4)
  17.             break;
  18.  
  19.     }
  20.     printf("MUITO OBRIGADO\nAlcool: %d\nGasolina: %d\nDiesel: %d\n",alc,gas,dis);
  21.  
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement