可能这个程序帮 :
程序代码:
#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
char s[100] = {};
cout << "Enter a character string which ends with '+' : ";
scanf("%[^+]+", s);
cout << "s : [" << s << "]" << endl;
}
[
本帖最后由 serious 于 2009-9-2 06:51 编辑 ]