Netwars

TURBO PASCAL ;;help[kkd]

[#1]
15.03.2007 11:21

jestem troche slaby z pascala i prosze o pomoc
mam napisac
1 program ktory bedzie odczytywac informacje z pliku .txt i wyswietlic to na ekranie
2 napisac jakis srednio skomplikowany program i opisac jak on dziala

thx

[#2]
15.03.2007 11:48

program plik;
var
f:text;
ch:char;
begin
Assign(f, 'a.txt');
Reset(f);
while not Eof(f) do
begin
while not Eoln(f) do
begin
Read(f, ch);
Write(ch);
end;
if not Eof(f) then
begin
Readln(f);
Writeln;
end;
end;
Close(f);
readln;
end.

[#3]
16.03.2007 09:31

podbije
ktos zrobi drugie ?

[#4]
16.03.2007 23:03

Oto drugie zadanko... Minimum i maximum z MENU + parametry

program program01;

uses
crt;

type Wektor = array[1..100] of integer;

var

Liczba:Integer;
IleLiczb1,IleLiczb2:Integer;
MINN,MAXX:Wektor;
i,j:integer;
klawisz:char;
maksimum,minimum:integer;

procedure MAX01(Liczba:Integer; var IloscLiczb:Integer; var Tablica:Wektor);

begin
clrscr;
writeln('Podaj ile liczb bedziesz podawac: ');
readln(IloscLiczb);
writeln('Podaj kolejno: ',IloscLiczb,', liczb');
for i:=1 to IloscLiczb do
begin
write('Liczba nr ',i,'=');
readln(Liczba);
MAXX[i]:=Liczba;
end;

i:=1;
Maksimum:=MAXX[i];
for i:=1 to IloscLiczb do

begin
if MAXX[i]>Maksimum then

begin
Maksimum:=MAXX[i]
end;

end;

end;

procedure MAX02;
begin
clrscr;
writeln('Maksymalna liczba wynosi: ',Maksimum);
readln;
end;

procedure MIN01(Liczba:Integer; IloscLiczb:Integer; Tablica:Wektor);

begin
clrscr;
writeln('Podaj ile liczb bedziesz podawac: ');
readln(IloscLiczb);
writeln('Podaj kolejno: ',IloscLiczb,', liczb');
for i:=1 to IloscLiczb do
begin
write('Liczba nr ',i,'=');
readln(Liczba);
MINN[i]:=Liczba;
end;

i:=1;
Minimum:=MINN[i];
for i:=1 to 5 do

begin
if MINN[i]<Minimum then

begin
Minimum:=MINN[i]
end;

end;

end;

procedure MIN02;
begin
clrscr;
writeln('Minimalna liczba wynosi: ',Minimum);
readln;
end;

procedure MENU;

begin
repeat
repeat
ClrScr;
Writeln('1: Oblicz maksimum.');
Writeln('2: Wyswietl maksimum.');
Writeln('3: Oblicz minimum.');
Writeln('4: Wyswietl minimum.');
Writeln;
Writeln('Klawisz Esc - koniec');

Klawisz:=ReadKey;

until (klawisz in ['1'..'4']) or (klawisz = #27);

case klawisz of
'1':MAX01(Liczba,IleLiczb1,MAXX);
'2':MAX02;
'3':MIN01(Liczba,IleLiczb2,MINN);
'4':MIN02;
end;
Until klawisz = #27;
end;

begin
MENU;
end.

Nie nawidzę tłumaczyć;/

[#5]
17.03.2007 11:53

#2 hahha 3 petle xD

var a:string;b:text;
begin
assign(b,'sciezka.txt');
reset(b);
while no eof(b) do
begin
readln(b,a);
writeln(a);
end;
end.

Zaloguj się, żeby odpowiedzieć.