Advertisement
SelinD

v90s3ex3

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