Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program Project2;
- {$APPTYPE CONSOLE}
- uses
- SysUtils;
- type
- tab = array[byte,byte] of byte;
- var
- kw:tab;
- p:byte;
- b,i,j:integer;
- jest:boolean;
- plik:file of tab;
- begin
- Randomize();
- writeln('Podaj bok: ');
- readln(b);
- for i:=1 to b do
- for j:=1 to b do
- kw[i,j]:=random(2);
- for i:=1 to b do
- begin
- for j:=1 to b do
- write(kw[i,j],' ');
- writeln;
- end;
- writeln;
- for j:=1 to b do
- begin
- jest:=true;
- i:=2;
- p:=kw[1,j];
- while (i<=b) and (jest) do
- begin
- if kw[i,j]<>p then
- jest:=false;
- i:=i+1;
- end;
- if jest then
- write(j,' ');
- end;
- assign(plik,'kwadrat.dat');
- rewrite(plik);
- write(plik,kw);
- close(plik);
- readln;
- end.
Add Comment
Please, Sign In to add comment