Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program Michal;
- uses crt;
- var
- a,d:integer;
- c,b:Integer;
- i,j:Integer;
- dziesiec:integer;
- Wybor:integer;
- t:array[1..10]of integer;
- label petlaforto, petlafordownto, petlawhile, czyszczenie, petlarepeat, tablica, menu;
- begin
- menu:
- writeln('Co chcesz zrobic?');
- writeln('-------------------');
- writeln('1 - Petla for to');
- writeln('2 - Petla for down to');
- writeln('3 - Zapis do tablicy');
- writeln('4 - Petla while');
- writeln('5 - Petla repeat');
- writeln('6 - Wyczysc');
- Writeln('-------------------');
- Readln(Wybor);
- case Wybor of
- 1:begin
- petlaforto:
- writeln('Wypisz liczby od 1 do');
- readln(c);
- clrscr;
- for c:=1 to c do
- begin
- writeln('Petla sie wykonala',' ', c);
- end;
- writeln('');
- goto menu;
- end;
- 2:
- begin
- petlafordownto:
- writeln('Podaj liczbe ktora chcesz wyzerowac');
- readln(b);
- clrscr;
- for b:=b downto 0 do
- begin
- writeln(b);
- end;
- writeln(' ');
- goto menu;
- end;
- 3:
- begin
- tablica:
- randomize;
- for i:=1 to 10 do
- begin
- t[i]:= random(10);
- writeln(t[i]:10);
- end;
- writeln(' ');
- goto menu;
- end;
- 4:
- begin
- petlawhile:
- writeln('Zwieksz/zmniejsz liczbe i wypisz tekst do momentu uzyskania liczby 10');
- readln(i);
- while i<10 do
- begin
- inc(i);
- writeln('Zwiekszono do', ' ', i);
- end;
- while i>10 do
- begin
- dec(i);
- writeln('Zmniejszono do', ' ', i);
- end;
- writeln(' ');
- goto menu;
- end;
- 5:
- begin
- petlarepeat:
- repeat
- write ('Wpisz liczbe 10: ');
- readln (j);
- until j = 10;
- writeln(' ');
- goto menu;
- end;
- 6:
- begin
- czyszczenie:
- clrscr;
- goto menu;
- end;
- end;
- end.
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement