69,371
社区成员
发帖
与我相关
我的任务
分享
#include <stdio.h>
char* pstr= "there 2 to 20:15:06 (\"成功登录服务器\") 正确";
char str1[100];
char str2[100];
char str3[100];
int iDate;
void main() {
sscanf(pstr, "there %d to %[^:]:%[^:]:%s",&iDate,str1,str2,str3);
printf("%d,%s,%s,%s\n",iDate,str1,str2,str3);
}
//2,20,15,06