GamerSK

Evidencia

May 17th, 2017
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 1.58 KB | None | 0 0
  1. program evidencia;
  2. {$APPTYPE CONSOLE}
  3. uses SysUtils;
  4. var ps,pt,i,j:byte; ht:string;
  5.     nt:array[1..255,1..255] of string;
  6.     pk:array[1..255,1..255] of byte;
  7.     ct:array[1..255,1..255] of single;
  8. begin
  9.   { TODO -oUser -cConsole Main : Insert code here }
  10.   write('Zadajte pocet skladov: ');
  11.   readln(ps);
  12.   write('Zadajte pocet tovarov: ');
  13.   readln(pt);
  14.   for i:=1 to ps do
  15.     begin
  16.       for j:=1 to pt do
  17.         begin
  18.           write('Zadajte nazov ',j,'. tovaru v ',i,' sklade: ');
  19.           readln(nt[i,j]);
  20.           write('Zadajte pocet kusov ',j,'. tovaru v ',i,' sklade: ');
  21.           readln(pk[i,j]);
  22.           write('Zadajte cenu za kus ',j,'. tovaru v ',i,' sklade: ');
  23.           readln(ct[i,j]);
  24.         end;
  25.     end;
  26.   for i:=1 to ps do
  27.     begin
  28.       write('#',i,' ');
  29.       for j:=1 to pt do
  30.         begin
  31.           write(nt[i,j]:5,pk[i,j]:3,ct[i,j]:6:2,', ');
  32.         end;
  33.       writeln;
  34.     end;
  35.   writeln('Vyhladavanie tovaru (Ukoncenie stop)');
  36.   repeat
  37.     write('Zadajte nazov hladaneho tovaru: ');
  38.     readln(ht);
  39.     if (ht='Stop') or (ht='stop') or (ht='stoP') or (ht='STOP') then break
  40.     else begin
  41.     for i:=1 to ps do
  42.       begin
  43.         for j:=1 to pt do
  44.           begin
  45.             if ht=nt[i,j] then
  46.               begin
  47.                 writeln(nt[i,j]:5,pk[i,j]:3,ct[i,j]:9:2);
  48.                 writeln('Produk sa nachadza v ',i,'. sklade.');
  49.               end;
  50.           end;
  51.       end;
  52.     end;
  53.   until (ht='Stop') or (ht='stop') or (ht='stoP') or (ht='STOP');
  54.   writeln('Pre ukoncenie programu stlacte ENTER');
  55.   readln;
  56. end.
Advertisement
Add Comment
Please, Sign In to add comment