Код
clrscr; gotoxy(25,10);
write ('Вопрос номер 9: ');
gotoxy (25,12);
write('Назовите столицу Щвеции ? ');
gotoxy(20,14);
write('1) Стокгольм; ');
gotoxy(20,16);
write('2) Гетеборг; ');
gotoxy(20,18);
write('3) Мальме; ');
gotoxy(25,24);
write('Ваш ответ : ');
nrep[9]:=GetRep;
if nrep[9] = nok[9] then nprav:=nprav+1;
clrscr; gotoxy(25,10);
write ('Вопрос номер 10: ');
gotoxy (25,12);
write('Назовите столицу Финляндии ? ');
gotoxy(20,14);
write('1) Коккола; ');
gotoxy(20,16);
write('2) Хельсинки; ');
gotoxy(20,18);
write('3) Сало; ');
gotoxy(25,24);
write('Ваш ответ : ');
nrep[10]:=GetRep;
if nrep[10] = nok[10] then nprav:=nprav+1;
clrscr; gotoxy(25,10);
write ('Вопрос номер 11: ');
gotoxy (25,12);
write('Назовите столицу Болгарии ? ');
gotoxy(20,14);
write('1) Девин; ');
gotoxy(20,16);
write('2) Айтос; ');
gotoxy(20,18);
write('3) София; ');
gotoxy(25,24);
write('Ваш ответ : ');
nrep[11]:=GetRep;
if nrep[11] = nok[11] then nprav:=nprav+1;
clrscr;
gotoxy(2,1);
textcolor(30);
Writeln('Вопрос: │ Ответ: │ Верно');
textcolor(15);
for i:=1 to nq do begin
write(i:5, ' │', nrep[i]:6, ' │ ');
if nok[i] = nrep[i] then write('Да')
else write('Нет');
if i<>nq then writeln;
end;
gotoxy(40,2);
write('╔════════════════════════════════════╗');
gotoxy(40,3);
write('║ ║');
gotoxy(40,4);
write('╠════════════════════════════════════╣');
gotoxy(40,5);
write('║ ║');
gotoxy(40,6);
write('╚════════════════════════════════════╝');
gotoxy(41,3);
write(' Количество вопросов: ', nq);
gotoxy(41,5);
write(' Количество правильных ответов: ', nprav);
{
textcolor(12);
clrscr;
gotoxy(19,7);
writeln('Кoличество вопросов: ', nq );
gotoxy(19,9);
writeln('Кoличество правильных ответов: ', nprav );
writeln(' Вопрос: Ответ: Верно?');
for i:=1 to nq do begin
write(i:5, ' ', nrep[i], ' ');
if nok[i] = nrep[i] then writeln('Да')
else writeln('Нет');
end; }
gotoxy(43,15);
write('Ваша оценка ');
if nprav=11 then
begin
write('"5"!');
write(' Ну ты отличник!')
end;
if (nprav=10) or (nprav=9) then begin write('"5-"!'); textcolor(15); end;
if (nprav=8) or (nprav=7) then write('"4"');
if (nprav=6) or (nprav=5) then write('"4-"');
if (nprav=4) or (nprav=3) then write('"3"');
if nprav=2 then write('"3-"');
if nprav=1 then write('"2"');
if nprav=0 then write('"1"');
gotoxy(43,20);
textcolor(15);
write('Хотите повторить тесты (y/n)? ');
repeat
ch:=UpCase(ReadKey);
write(ch);
until ch in ['Y', 'N']; { ch in ['0'..'9'] }
until ch <> 'Y';
end.