PascalABC.NET 3.3
program journal;
var
sum, mark, count, n: integer;
check: boolean;
begin
sum := 0;
check := true;
count := 0;
writeln('Введите количество оценок: ');
readln(n);
if (n > 0) then begin
while (count <> n) do
begin
readln(mark);
inc(sum, mark);
if (mark < 4 ) then check := false;
inc(count);
if (count = n) then writeln('Ввод окончен!');
end;
end else writeln('Error!');
if ((check) and (sum > 0) and (n > 0)) then writeln('Ты молодец!');
end.
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Введите число a:");
int a = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Введите число b:");
int b = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Введите число c:");
int c = Convert.ToInt32(Console.ReadLine());//Вводим 3 числа
int sredAref = a + b + c / 3;//Считаем
Console.WriteLine("Среднее Арифметическое : " + sredAref);// Выводим
Console.ReadKey();
}
}
Объяснение: