利用getline()函数进行分隔,得到每一个独立的操作码,然后再对操作码进行判断 /* HW字符串操作1 */ #include <bits/stdc++.h> using namespace std; int main() { string s,t; int x=0,y=0; while(getline(cin,s)){ stringstream ss(s); while(getline(ss,t,';')){ if(t.empty()||t.length()>3)continue; string _=t.substr(1); if(regex_match(_, rege...