Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var
- i, line: integer;
- c1, c2, c3: char;
- b1, b2, b3: boolean;
- procedure checkFIO(s: string);
- begin
- read(c1);
- if ((c1 < 'А') or (c1 > 'Я')) and ((c1 < 'а') or (c1 > 'я')) then
- b1 := true
- else if ((c1 >= 'а') and (c1 <= 'я')) then
- writeln(s, ' с маленькой буквы');
- read(c1);
- while c1 <> ' ' do
- begin
- if (c1 >= 'А') and (c1 < 'Я') then
- b2 := true
- else if (c1 < 'а') or (c1 > 'я') then
- b1 := true;
- read(c1);
- end;
- if b2 then
- writeln('В строке ', line, ' ', s, ' содержит заглавние буквы, не на первой позиции');
- if b1 then
- writeln('В строке ', line, ' ', s, ' содержит недопустимые символы');
- end;
- procedure checkNuberSlash(s: string; l, r: integer);
- begin
- b1 := false;
- b2 := false;
- i := 0;
- read(c1);
- while c1 <> '/' do
- begin
- if c1 = ' ' then
- b2 := true
- else if (c1 < '0') or (c1 > '9') then
- b1 := true
- else
- i := i * 10 + ord(c1) - 48;
- read(c1);
- end;
- if b2 then
- writeln('В строке ', line, ' ', 'В дате не 3 числа');
- if b1 then
- writeln('В строке ', line, ' ', s, ' содержит недопустимые символы')
- else if not ((i >= l) and (i <= r)) then
- writeln('В строке ', line, ' ', 'Недопустимый ', s);
- end;
- procedure checkFourNumbers(s: string);
- var
- i: integer;
- begin
- b1 := false;
- for i := 1 to 4 do
- begin
- read(c1);
- if (c1 = ' ') or (ord(c1) = 13) or ((eof(input)) and (i <> 4)) then
- begin
- writeln('В строке ', line, ' ', s, ' содержит неверное колличество цифр');
- Exit;
- end;
- if not ((c1 >= '0') and (c1 <= '9')) then
- b1 := true;
- end;
- if b1 then
- writeln('В строке ', line, ' ', s, ' содержит недопустимые символы');
- if not eof(input) then
- read(c1);
- end;
- begin
- assign(input, 'input.txt');
- assign(output, 'output.txt');
- reset(input);
- rewrite(output);
- line := 1;
- while not eof(input) do
- begin
- b1 := false;
- b2 := false;
- checkFIO('Фамилия');
- checkFIO('Имя');
- checkFIO('Отчество');
- read(c2, c3);
- if c3 = ' ' then
- begin
- if (c2 = 'М') or (c2 = 'Ж') then
- writeln('В строке ', line, ' ', 'Пол с заглавной буквы')
- else if not ((c2 = 'м') or (c2 = 'ж')) then
- writeln('В строке ', line, ' ', 'Неверный символ пола');
- end
- else
- begin
- writeln('В строке ', line, ' ', 'Неверное колличество символов пола');
- while c1 <> ' ' do
- read(c1);
- end;
- checkNuberSlash('День', 1, 31);
- if not b2 then
- checkNuberSlash('Месяц', 1, 12);
- if not b2 then
- checkFourNumbers('Год');
- checkFourNumbers('Ид');//Не ебу как назвать 4 числа последнии, предположим это ид
- line := line + 1;
- readln();
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement