fork download
  1. #include <stdio.h>
  2.  
  3. int prefix(const char *str, const char *prefix)
  4. {
  5. return strncmp(str, prefix, strlen(prefix)) == 0;
  6. }
  7.  
  8. int main(void) {
  9. // your code goes here
  10. if (prefix("", "ab")) {
  11. printf("OK");
  12. } else {
  13. printf("NO");
  14. }
  15. return 0;
  16. }
  17.  
Success #stdin #stdout 0s 4540KB
stdin
Standard input is empty
stdout
NO