Advertisement
catalyn

problema 1 tema 27.11.2014

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