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 poeni;
- if(ocenka == 2) {
- poeni = 60;
- }
- else if(ocenka == 3) {
- poeni = 70;
- }
- else if(ocenka == 4) {
- poeni = 80;
- }
- else if(ocenka == 5) {
- poeni = 90;
- }
- int T1, T2, T3, T4;
- cin >> T1 >> T2 >> T3 >> T4;
- int zbir = T1 + T2 + T3 + T4;
- int res = -1;
- for(int i = 0; i <= 100; i++) {
- if((zbir + i) / 5 >= poeni) {
- res = i;
- break;
- }
- }
- if(res == -1) {
- cout << "GRESHKA" << endl;
- }
- else {
- cout << res << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment