Advertisement
Guest User

2zad

a guest
Apr 26th, 2018
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4.  
  5. namespace Laba2
  6. {
  7. class Program
  8. {
  9. static void Main(string[] args)
  10. {
  11. int a;
  12. float sr = 0;
  13. Console.WriteLine("Введите размер массива");
  14. a = Convert.ToInt32(Console.ReadLine());
  15. int[] m= new int[a];
  16. Console.WriteLine("Введите элементы массива");
  17. for (int i = 0; i < a; i++)
  18. {
  19. m[i] = Convert.ToInt32(Console.ReadLine());
  20. sr += m[i];
  21. }
  22. sr=sr/a;
  23. Console.WriteLine("Ср. ариф. = "+sr);
  24. Console.ReadKey();
  25.  
  26.  
  27. }
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement