fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int main()
  5. {
  6.  
  7. int x,y,z;
  8. char *str="1-2*3";
  9. int a = sscanf(str, "%d-%d-%d", &x, &y, &z);
  10. printf( "%s", (a == 3) ? "Correct format":"Incorrect format");
  11.  
  12. return 0;
  13.  
  14. }
Success #stdin #stdout 0s 2112KB
stdin
Standard input is empty
stdout
Incorrect format