This commit is contained in:
2026-03-10 16:27:53 +01:00
parent be6ca147f2
commit fd9be86bde
11 changed files with 132 additions and 1 deletions

View File

@@ -0,0 +1,30 @@
#include <iostream>
using namespace std;
double srednia(int a, int b, int c) { return (double)(a + b + c) / 3; }
double srednia(int a, int b) { return (double)(a + b) / 2; }
double srednia(int a, int b, int c, int d) {
return (double)(a + b + c + d) / 4;
}
bool czyZaliczyl(double wynik, double prog = 3.0) { return wynik >= prog; }
int main() {
int a, b, c;
cout << "Podaj a: ";
cin >> a;
cout << "Podaj b: ";
cin >> b;
cout << "Podaj c: ";
cin >> c;
double avg = srednia(a, b, c);
cout << "Twoja średnia wynosi: " << avg << endl;
if (czyZaliczyl(avg)) {
cout << "Zaliczyłeś, brawo!" << endl;
} else {
cout << "Nie zaliczyłeś :(" << endl;
}
}