Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function SizeOfMatrix(MyFile: TextFile) : integer;
- var
- numb, n, numbEx: integer;
- isCorrect, firstIt: boolean;
- begin
- n := 0;
- numb := 0;
- firstIt := true;
- isCorrect := true;
- while (not eof(MyFile)) and isCorrect do
- begin
- numbEx := numb;
- numb := 0;
- while not eoln(MyFile) do
- begin
- inc(numb);
- read (MyFile, numb);
- end;
- if numbEx <> numb then
- isCorrect := false;
- if firstIt then
- begin
- isCorrect := true;
- firstIt := false;
- end;
- inc(n);
- readln(MyFile);
- end;
- if isCorrect and (numb = n) then
- Result := n
- else
- Result := 0;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement