Advertisement
c_andreea

2017_Sesiune-speciala-SIII3

Nov 22nd, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.46 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3. int egale(int a)
  4. {
  5.     int u=a%10;
  6.     while(a!=0)
  7.     {
  8.         if(a%10==u)
  9.         {
  10.             return 0;
  11.            
  12.             a=a/10;
  13.         }
  14.         return 1;
  15.     }
  16. }
  17. void identice(int a, int b)
  18. {
  19.     int i,ok=0;
  20.     for(i=1;i<=b;i++)
  21.     {
  22.         if(egale(i)==1)
  23.         {
  24.             cout<<i;
  25.             ok=1;
  26.         }
  27.     }
  28.     if(ok==0)
  29.     {
  30.         cout<<"NU EXISTA";
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement