p1是指向string s1的迭代器
运行到p1与p1+字符串中字母E位置下标,比较的时候就报错
- #include
using namespace std;
#include
#include
int main()
{
string s1, s2;
int c1 = 0, c2 = 0;
string::iterator p1=s1.begin();
cin >> s1 >> s2;
s1 += s2;
int end_pos = s1.find('E',0);
for(;p1!=p1+end_pos;p1++)
{