Advertisement
Guest User

Untitled

a guest
Jan 21st, 2020
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. float suma = 0;
  2. float ilosc = 0;
  3.  
  4. for (int liczba : liczby)
  5. {
  6. if (liczba >= -5 && liczba <= 6)
  7. {
  8. suma += liczba;
  9. ilosc++;
  10. }
  11. }
  12.  
  13. float srednia = suma / ilosc;
  14.  
  15. std::cout << "Średnia arytmetyczna wynosi: " << srednia << std::endl;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement