Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class program
- {
- public static void Main()
- {
- int n;
- double average = 0, sum = 0;
- Console.Write("Введите количество оценок:\t");
- n = Convert.ToInt32(Console.ReadLine());
- int[] a = new int[n];
- for (int i = 0; i < n; i++)
- {
- Console.Write("Оценка №{0}:\t", i + 1);
- a[i] = Convert.ToInt32(Console.ReadLine());
- sum += a[i];
- }
- average = sum / n;
- Console.Write("\nСреднее:\t{0:f1}", average);
- Console.ReadKey();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement