#include <stdio.h> int main() { char cTmp[100] = ""; //输入字符串,输入#,,输入数字,再输入换行 scanf("%s", cTmp); char cFru[50] = ""; int nNum = 0; sscanf(cTmp, "%[^#]#%d", cFru, &nNum); printf("cFru:%s, nNum:%d\n", cFru, nNum); return 0; }
[此贴子已经被作者于2017-5-17 12:21编辑过]