Generovanie matematických úloh
program matem_ulohy;
var i, a, b,vysl,p, ps:integer;
z:char;
begin
randomize;
write ('Zadaj pocet uloh:'); readln(p);
write ('Zvol znak matematickej operacie:'); readln(z);
case z of
'+': for i:=1 to p do begin a:=random(101);
b:=random(101-a);
write(a,'+',b,'=');
readln(vysl);
if vysl=a+b then inc(ps)
end;
'-': for i:=1 to p do begin a:=random(101);
b:=random(101);
if a<b then begin a:=a+b;
b:=a-b;
a:=a-b;
end;
write(a,'-',b,'=');
readln(vysl);
if vysl=a-b then inc(ps)
end;
'*': for i:=1 to p do begin a:=random(10);
b:=random(10);
write(a,'*',b,'=');
readln(vysl);
if vysl=a*b then inc(ps)
end
else write('taku operaciu nepoznam!!!');
end;
writeln('Tvoja uspesnost v teste je ',round(ps/p*100),'%');
readln;
end.