Ввести информацию по 3-м студентам ( порядковый номер, Ф.И.О. и три оценки) определить количество отличников и средний бал каждого студента — Pascal(Паскаль)

Program zap_1;

Type
  student = record
    n: integer;
    fio: string[40];
    bal: array [1 .. 3] of integer end;

  Var
    spisok: student;
    i, j, kol, s: integer;
    sr: real;

  Begin
    kol := 0;
    With spisok do
      For i := 1 to 3 do
      begin
        n := i;
        Write(' введите фамилию ', i, ' ');
        Readln(fio);
        s := 0;
        For j := 1 to 3 do
        begin
          write('введите оценку: ');
          Readln(bal[j]);
          s := s + bal[j];
        end;
        if s = 15 then
          kol := kol + 1;
        sr := s / 3;
        writeln(fio, ', средний бал = ', sr:4:1);
      end;
    writeln(' количество отличников= ', kol);
    Readln;

end.

Leave a Comment

75 + = 81