Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program HelloWorld;
- var y:integer;
- function year(n:integer):boolean;
- var ch:string;
- begin
- str(n,ch);
- if (ch[1]<>ch[2]) and (ch[1]<>ch[3]) and (ch[1]<>ch[4]) and (ch[2]<>ch[3]) and (ch[2]<>ch[4]) and (ch[4]<>ch[3]) then
- year:=true
- else
- year:=false;
- end;
- begin
- readln(y);
- repeat
- y:=y+1;
- if (year(y)) then
- writeln(y);
- until(year(y));
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement