Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main(){
- int ocenka;
- cin >> ocenka;
- int testovi[4]; // niza od broevi
- for(int i = 0; i < 4; i++) { // i++ e isto so i += 1
- cin >> testovi[i]; // vnesuvanje na nizata
- }
- int potrebni_poeni = -1;
- for(int poeni = 0; poeni <= 100; poeni++) { // poeni++ e isto so poeni += 1
- int prosek = (testovi[0] + testovi[1] + testovi[2] + testovi[3] + poeni) / 5;
- if(prosek >= 60 and ocenka == 2) {
- potrebni_poeni = poeni;
- break;
- }
- if(prosek >= 70 and ocenka == 3) {
- potrebni_poeni = poeni;
- break;
- }
- if(prosek >= 80 and ocenka == 4) {
- potrebni_poeni = poeni;
- break;
- }
- if(prosek >= 90 and ocenka == 5) {
- potrebni_poeni = poeni;
- break;
- }
- }
- if(potrebni_poeni == -1) {
- cout << "GRESHKA" << endl;
- }
- else {
- cout << potrebni_poeni << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment