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 s = 0;
- cin >> s;
- int zbir = 0;
- for(int i = 0; i < s - 1; i++) {
- zbir += niza[i];
- }
- int internet = 100;
- if(zbir >= 1 and zbir <= 5) {
- internet -= 20;
- }
- if(zbir >= 6 and zbir <= 20) {
- internet -= 40;
- }
- if(zbir > 20) {
- internet -= 50;
- }
- cout << internet << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement