不知为何使用各种字符串读入总会有换行或不换行,以及漏行的问题,最终可行的写法:
for(ll i=1;i<=n;i++) { getline(cin,s); if(s.length()==0||s[0]!='F'&&s[0]!='R') { i--; continue; } ****** }