Advertisement
Josif_tepe

Untitled

Apr 13th, 2021
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int niza[5];
  6. for(int i = 0; i < 5; i++) {
  7. cin >> niza[i];
  8. }
  9. int s = 0;
  10. cin >> s;
  11. int zbir = 0;
  12. for(int i = 0; i < s - 1; i++) {
  13. zbir += niza[i];
  14. }
  15. int internet = 100;
  16. if(zbir >= 1 and zbir <= 5) {
  17. internet -= 20;
  18. }
  19. if(zbir >= 6 and zbir <= 20) {
  20. internet -= 40;
  21. }
  22. if(zbir > 20) {
  23. internet -= 50;
  24. }
  25. cout << internet << endl;
  26. return 0;
  27.  
  28. }
  29.  
  30.  
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement