rikardoricz

20 IF Tomasz Świątek 3BTI/2

Nov 17th, 2020
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.67 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     float n,k;
  8.  
  9.     cout << "Podaj wielkosc nakladu: " << endl;
  10.     cin >> n;
  11.  
  12.     k=0;
  13.  
  14.     if (n<0)
  15.     {
  16.         cout << "Podano nieprawidlowa wielkosc nakladu, ktora nie moze byc mniejsza niz 0.";
  17.     }
  18.     else if (n<500)
  19.     {
  20.         k=15;
  21.         cout << "Koszt wydruku wynosi " << k*n << " zl dla nakladu " << n;
  22.     }
  23.     if (n>=500 && n<=1000)
  24.     {
  25.         k=12;
  26.         cout << "Koszt wydruku wynosi " << k*n << " zl dla nakladu " << n;
  27.     }
  28.     if (n>1000)
  29.     {
  30.         k=10;
  31.         cout << "Koszt wydruku wynosi " << k*n << " zl dla nakladu " << n;
  32.     }
  33.  
  34.     return 0;
  35. }
  36.  
Add Comment
Please, Sign In to add comment