Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int niza[5];
- for(int i = 0; i < 5; i++)
- {
- cin >> niza[i];
- }
- int kabinet;
- cin >> kabinet;
- int internet = 100;
- if (kabinet == 1)
- {
- cout << internet << endl;
- return 0;
- }
- else if(kabinet == 2)
- {
- if(niza[0] <= 5 and niza[0] > 0)
- {
- internet -= 20;
- }
- else if(niza[0] >= 6 and niza[0]<= 20)
- {
- internet -= 40;
- }
- else if(niza[0] > 20)
- {
- internet -= 50;
- }
- cout << internet << endl;
- }
- else if(kabinet == 3)
- {
- int zbir = niza[0] + niza[1];
- if(zbir <= 5 and zbir > 0)
- {
- internet -= 20;
- }
- else if(zbir >= 6 and zbir <= 20)
- {
- internet -= 40;
- }
- else if(zbir > 20)
- {
- internet -= 50;
- }
- cout << internet << endl;
- }
- else if(kabinet == 4)
- {
- int zbir = niza[0] + niza[1] + niza[2];
- if(zbir <= 5 and zbir > 0)
- {
- internet -= 20;
- }
- else if(zbir >= 6 and zbir <= 20)
- {
- internet -= 40;
- }
- else if(zbir > 20)
- {
- internet -= 50;
- }
- cout << internet << endl;
- }
- else if(kabinet == 5)
- {
- int zbir = niza[0] + niza[1] + niza[2] + niza[3];
- if(zbir <= 5 and zbir > 0)
- {
- internet -= 20;
- }
- else if(zbir >= 6 and zbir <= 20)
- {
- internet -= 40;
- }
- else if(zbir > 20)
- {
- internet -= 50;
- }
- cout << internet << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement