Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- public class Program
- {
- public static void Main()
- {
- Console.WriteLine("Избери брой оценки: ");
- int n = int.Parse(Console.ReadLine());
- double[] ocenki = new double[n];
- ////////////////////////////////////////////////////////////////
- for(int i = 0; i < ocenki.Length; i++)
- {
- Console.WriteLine("Въведи оценка {0}", i);
- ocenki[i] = double.Parse(Console.ReadLine());
- }
- double sym = 0;
- int Vchisla = 0;
- for(int i = 0; i < ocenki.Length; i++)
- {
- if (ocenki[i] <= 6 && ocenki[i] >= 2)
- {
- Vchisla ++;
- sym += ocenki[i];
- }
- }
- double avg = sym / Vchisla;
- Console.WriteLine( "Невалидни оценки : {0}", n - Vchisla);
- Console.WriteLine( "Валидни оценки : {0}", Vchisla);
- Console.WriteLine("Средният успех е {0:f2}", avg);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement