Advertisement
ShafiulAzim

uri1134

Jan 22nd, 2020
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5. int n,a=0,b=0,c=0;
  6. cout<<"MUITO OBRIGADO"<<endl;
  7. while(cin>>n)
  8. {
  9. if(n==4)
  10. break;
  11. if(n==1 || n==2 || n==3)
  12. {
  13. switch(n)
  14. {
  15. case 1:
  16. a++;
  17. break;
  18. case 2:
  19. b++;
  20. break;
  21. case 3:
  22. c++;
  23. break;
  24. }
  25. }
  26. else
  27. continue;
  28. }
  29. cout<<"Alcool: "<<a<<endl<<"Gasolina: "<<b<<endl<<"Diesel: "<<c<<endl;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement