Advertisement
oscar-alex11

Cifras_Repetidas

Sep 16th, 2013
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.50 KB | None | 0 0
  1. program numero;
  2. Var num, cifra, cifraN, aux: Integer;
  3.     cifrasiguales: Boolean;
  4. Begin
  5. write('Ingrese el numero: ');
  6. readln(num);
  7. cifrasIguales:= False;
  8. Repeat
  9.    Begin
  10.      cifra:= num mod 10 ;
  11.      num:= num div 10;
  12.      aux:= num;
  13.        Repeat
  14.           Begin
  15.           cifraN:= aux mod 10;
  16.           aux:= aux div 10;
  17.           cifrasIguales:= cifra=cifraN
  18.           end
  19.        Until cifrasIguales or (aux=0);
  20.    End
  21. Until cifrasIguales or (num=0);
  22. writeln(cifrasIguales);
  23. readln();
  24. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement