-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtablice.pas
More file actions
46 lines (46 loc) · 1.15 KB
/
Copy pathtablice.pas
File metadata and controls
46 lines (46 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
uses crt,wincrt;
var resenje,a,b,c,rezultat:longint;
begin
clrscr;
Writeln('Dobrodosli u tablicu mnozenja, sabiranja i oduzimanja, da izadjete ukucajte 1000 i pritisnite enter');
Writeln('Ja sam glupav, Copyright 2010');
writeln();
while resenje<1000 do
begin
a:=random(9);
b:=random(9);
c:=1+random(3);
textcolor(white);
case c of
1:begin
rezultat:=a+b;
writeln('Koliko je ',a,' + ',b,'?');
end;
2:begin
rezultat:=a-b;
writeln('Koliko je ',a,' - ',b,'?');
end;
3:begin
rezultat:=a*b;
writeln('Koliko je ',a,' * ',b,' ?');
end;
4:begin
rezultat:=0;
writeln('Koliko je ',a,' / ',b,'?');
end;
end;
readln(resenje);
if resenje=rezultat
then begin
textcolor(green);
writeln('Tacno!');
end
else begin
textcolor(red);
writeln('NE! Rezultat je: ',rezultat);
sound(9000);
delay(100);
nosound;
end;
end;
end.