1 简单模拟下就行 把10变为2 最后数最长2的个数 string s; cin >> s; int len = s.length(); int count = 0; for (int i = 0; i < len;) { while (s[i] == '2' &&i<len) { i++; } int ileft = i; int iright = i + 1; while (iright <len...