Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.37 KB | None | 0 0
  1. 3.1
  2. int n;
  3.         Console.Write("Podaj wielkosc zbioru: ");
  4.         n = Convert.ToInt32(Console.ReadLine());
  5.         int suma_zbioru = 0;
  6.         for(int x = 0; x < n; x++){
  7.             Console.Write("Podaj liczbe: ");
  8.             suma_zbioru += Convert.ToInt32(Console.ReadLine());
  9.             Console.WriteLine("");
  10.         }
  11.         double sa;
  12.         sa = suma_zbioru/n;
  13.         Console.WriteLine("Srednia arytmetyczna zbioru wynosi: "+sa);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement