Advertisement
Guest User

Untitled

a guest
Jan 24th, 2020
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. #include <string>
  2. #include <iostream>
  3. using namespace std;
  4. int main()
  5. {
  6. int a;
  7. float b,c,d;
  8. string e;
  9. cout<<"podaj cene towaru : "<<endl;
  10. cin>>a;
  11. cout<<"czy to towar dla dzieci? wpisz tak:"<<endl;
  12. cin>>e;
  13. if(a<200)
  14. {
  15. b=0;
  16. }
  17. else
  18. {
  19. if(a>200&&a<1000)
  20. {
  21. b=0.15;
  22. }
  23. else
  24. if(a>1000)
  25. {
  26. b=0.22;
  27. }
  28. if(e=="tak")
  29. {
  30. b=0.05;
  31. }
  32. }
  33. c=a*b;
  34. d=a-c;
  35. cout<<"Cena towaru po odjeciu podatku:"<<d<<endl;
  36.  
  37.  
  38.  
  39. return 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement