fork download
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. const char msg[]="( 3,5) (300 ,500) (543, 657) (1,2) ( 7 , 9 )";
  6. const char *ptr;
  7. int y,x,ret,offset;
  8. for(ptr=msg;sscanf(ptr," ( %d , %d )%n",&y,&x,&offset)==2;ptr+=offset) printf("%d,%d\n",y,x);
  9. return 0;
  10. }
Success #stdin #stdout 0s 2156KB
stdin
Standard input is empty
stdout
3,5
300,500
543,657
1,2
7,9