我想找到复数+
或-
复数的位置,例如
x + y*i
x - y*i
通常,我会这样做:
int found = str.find("+");
if (found != string::npos)
cout << "'+' also found at: " << found << endl;
found = str.find("-");
if (found != string::npos)
cout << "'-' also found at: " << found << endl;
如何find
在一次运行中提供多个选项来查找?