Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program linar;
- uses crt;
- var a:array[1..20] of byte;
- i,pv,x:byte;
- begin
- clrscr;
- randomize;
- writeln('Zadej cislo od 0-30');
- readln(x);
- for i:=1 to 20 do
- begin
- a[i]:= random(31);
- write(a[i],', ');
- end;
- writeln;
- for i:=1 to 20 do
- if a[i]=x then pv:=pv+1;
- if pv>0 then writeln('Cislo ',x,' se v danem poli vyskytuje ',pv,'x.')
- else
- writeln('Zadane cislo se v poli nevyskytuje.');
- readln;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement