我知道你没试过第一个。。。
第二个如果是减法怎么确定分割基准。。。
那就不要依赖库函数自己写一个新的函数
还有一个选项是借助LEX使用正则表达式来解决这个问题
没其他办法么?
追答还有就是楼上说的
#include
#include
int main()
{
char str[512];
char *a;
char *b;
char c;
fgets(str,512,stdin);
a=strtok(str, "+");
b=strtok(NULL,"+");
c='+';
printf("%s\n",a);
printf("%s\n",b);
return 0;
}