ACM上的一个题,,提交时运行超时怎么办??
程序代码:
# include <stdio.h> # include <string.h> int main() { char str[100]; int i,j,k,m; scanf ("%d", &m); while (m > 0) { scanf ("%s", str); for (i=0; i<100; i++) { if (str[i] == '/') break; } for (j=i+2; j<100; j++) { if (str[j] == ':' || str[j] == '/') break; } for (k=i+2; k<j; k++) printf ("%c", str[k]); printf ("\n"); m--; } return 0; }