版本比较
题解:P13186 [GCJ 2016 Qualification] Revenge of the Pancakes
正文
增加 3 行删除 3 行
23 行未改动242526272828293031323233343535363738394 行未改动23 行未改动using namespace std;char S[101];int T,flips,len;int main() { cin>>T; cin>>T; for(int t=1;t<=T;++t){ flips=0; cin>>S; len=strlen(S); len=strlen(S); for(int i=len-1;i>=0;--i){ if((S[i]=='-'&&(flips%2==0))||(S[i]=='+'&&(flips%2==1))){ flips++; flips++; } } cout<<"Case #"<<t<<": "<< flips<<endl; }4 行未改动