Advertisement
NadyaMisheva

masivi

Feb 2nd, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.59 KB | None | 0 0
  1. using System;
  2.                    
  3. public class Program
  4. {
  5.     public static void Main()
  6.     {
  7.         Console.WriteLine("Избери брой оценки: ");
  8.         int n = int.Parse(Console.ReadLine());
  9.        
  10.         double[] ocenki = new double[n];
  11.        
  12.         for(int i = 0; i < ocenki.Length; i++)
  13.         {
  14.             Console.WriteLine("Въведи оценка {0}", i);
  15.             ocenki[i] = double.Parse(Console.ReadLine());
  16.         }
  17.        
  18.         double sym = 0;
  19.         for(int i = 0; i < ocenki.Length; i++)
  20.         {
  21.             sym += ocenki[i];
  22.         }
  23.         double avg = sym / ocenki.Length;
  24.         Console.WriteLine("Средният успех е {0:f2}", avg);
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement