Sybatron

INFORMATIKA HOMEWORK 104/4

Oct 17th, 2018
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.93 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace TEST_Homework
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             double[] grades = new double[13];
  14.             double avg=0;
  15.             int br = 0;
  16.             for(int i=0;i<grades.Length;i++)
  17.             {
  18.                 Console.Write("Въведете {0}-та оценка",i+1);
  19.                 grades[i] = double.Parse(Console.ReadLine());
  20.                 avg += grades[i];
  21.             }
  22.             avg /= 13.0;
  23.             for (int i = 0; i < grades.Length; i++)
  24.             {
  25.                 if(grades[i]>avg)
  26.                 {
  27.                     br++;
  28.                 }
  29.             }
  30.             Console.WriteLine("Учениците с по-голям успех от средния успех на групата е: {0}",br);
  31.         }
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment