16-03-2008.txt

(1 KB) Pobierz
// zczytywane znaku asci

program Untitled;

uses CRT, DOS;

var
a:char;

begin
a:=readkey;
writeln( Ord (a));;
readln;

end.

// zczytywane znaku asci z petla 

program Untitled;

uses CRT, DOS;

var
a:char;

begin
Repeat
a:=readkey;
writeln( Ord (a));;
Until a=Chr(27);


end.


// zczytywanie znak�w strzalek asci z petla

program Untitled;

uses CRT, DOS;

var
c1,c2: char;

begin
Repeat
c1:=readkey;
c2:=' ';
if c1=chr(0) then c2:=readkey;
if c2='H' then writeln('Gora');
if c2='P' then writeln('Dol');
if c2='M' then writeln('Prawo');
if c2='K' then writeln('Lewo');
until c1=chr(27);
end.

// tabela z rekordami, wpisywanie danych do tabeli i wyswietlanie ich

program Untitled;

uses CRT,DOS;

var
a,t:string[50];
katalog: array[1..2] of record
autor : string[30];
tytul : string[20];
end;

begin
writeln('Podaj autora');
readln(a);
writeln('Podaj tytul');
readln(t);
katalog[1].autor:=a;
writeln;
writeln;
writeln('autor : ',katalog[1].autor);
katalog[2].tytul:=t;
writeln('tytul: "',katalog[2].tytul,'"');

readkey;
end.
Zgłoś jeśli naruszono regulamin