fork download
  1. #include <stdbool.h>
  2. #include <stdio.h>
  3.  
  4. int main() {
  5. char *problem = "a1b123df2323g2sdsf";
  6. bool need_new_line = false;
  7. for(char *i = problem; *i; ++i) {
  8. if(*i >= '0' && *i <= '9') {
  9. putchar(*i);
  10. need_new_line = true;
  11. } else if(need_new_line) {
  12. putchar('\n');
  13. need_new_line = false;
  14. }
  15. }
  16. }
Success #stdin #stdout 0s 9424KB
stdin
Standard input is empty
stdout
1
123
2323
2