Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- float suma = 0;
- float ilosc = 0;
- for (int liczba : liczby)
- {
- if (liczba >= -5 && liczba <= 6)
- {
- suma += liczba;
- ilosc++;
- }
- }
- float srednia = suma / ilosc;
- std::cout << "Średnia arytmetyczna wynosi: " << srednia << std::endl;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement