Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Meno, hmotnost, vyska
- //pridat
- //vypisat
- program menohmotnostvyska;
- {$APPTYPE CONSOLE}
- uses SysUtils;
- var m,h,v:text; meno,hmotnost,vyska,hl:string;
- vyskyt:boolean; i:byte;
- begin
- { TODO -oUser -cConsole Main : Insert code here }
- assign(m,'meno.txt'); assign(h,'hmotnost.txt'); assign(v,'vyska.txt');
- reset(m); reset(h); reset(v);
- vyskyt:=false;
- writeln('Vypis databazy:');
- while not eof(m) do
- begin
- vyskyt:=true;
- readln(m,meno);
- readln(h,hmotnost);
- readln(v,vyska);
- writeln(' ',meno:5,hmotnost:5,vyska:5);
- end;
- if vyskyt=false then writeln(' V databaze nieje ziadny udaj!');
- close(m); close(h); close(v);
- append(m); append(h); append(v);
- i:=1;
- writeln('Zadavanie ukoncite 0');
- repeat
- write('Zadajte ',i,' meno: ');
- readln(meno);
- if meno='0' then break;
- writeln(m,meno);
- write('Zadajte ',i,' hmotnost: ');
- readln(hmotnost);
- writeln(h,hmotnost);
- write('Zadajte ',i,' vysku: ');
- readln(vyska);
- writeln(v,vyska);
- inc(i);
- until meno='0';
- close(m); close(h); close(v);
- writeln('Vyhladavanie ukoncite 0');
- repeat
- reset(m); reset(h); reset(v);
- write('Zadajte hladane meno: ');
- readln(hl);
- if hl='0' then break;
- while not eof(m) do
- begin
- readln(m,meno);
- readln(h,hmotnost);
- readln(v,vyska);
- if hl=meno then writeln(' ',meno:5,hmotnost:5,vyska:5);
- end;
- close(m); close(h); close(v);
- until hl='0';
- end.
Advertisement
Add Comment
Please, Sign In to add comment