Advertisement
RusSimona

Varianta90 Sub3 Ex3

Mar 26th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. #include<iostream>
  2. #include<fstream>
  3. using namespace std;
  4. //ifstream fin("bac.txt");
  5.  
  6. int verif (int n ,int a)
  7. {
  8. int ok=1;
  9. while(n)
  10. {
  11. if(n%10>a) ok=0;
  12. n=n/10;
  13. }
  14. if(ok) return 1;
  15. else
  16. return 0;
  17. }
  18.  
  19.  
  20. int main()
  21.  
  22. {
  23. int b, n, i;
  24. cin>>n;
  25. for(i=2;i<=n;i++)
  26. if(verif(n, i-1)==0)
  27. cout<<i<<" ";
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement