fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <stdbool.h>
  4.  
  5. bool abcdef(int num) {
  6. int u,m;
  7. if(!(num/10)) //jezeli jednocyfrowa
  8. return false;
  9. while(num) {
  10. m = num%10;
  11. num /= 10;
  12. u = num%10;
  13. if(u > m)
  14. return false;
  15. }
  16. return true;
  17. }
  18.  
  19. int main(void) {
  20. int test[] = { 123357, 0, 110, 57, 1, 777 };
  21. size_t n = sizeof(test)/sizeof(test[0]);
  22. while(n--) {
  23. if(abcdef(test[n]))
  24. printf("%d\n",test[n]);
  25. }
  26. return 0;
  27. }
Success #stdin #stdout 0s 2248KB
stdin
Standard input is empty
stdout
777
57
123357