Advertisement
amine99

Untitled

Jan 23rd, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.35 KB | None | 0 0
  1. program HelloWorld;
  2. var y:integer;
  3.  
  4. function year(n:integer):boolean;
  5. var ch:string;
  6. begin
  7. str(n,ch);
  8. 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
  9. year:=true
  10. else
  11. year:=false;
  12. end;
  13.  
  14. begin
  15. readln(y);
  16. repeat
  17. y:=y+1;
  18. if (year(y)) then
  19. writeln(y);
  20. until(year(y));
  21. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement