c++题目,,为什么交上去是wrong answer?
1个回答

你没考虑完全,你的程序最多匹配两个字符就认为满足要求了!但实际上,小饰条的后面几个并不匹配!

#include

#include

#include

using namespace std;

int main()

{

for(string s; cin>>s;)

{

if(s[0]=='#')

break;

else

{

int sum=0,len=(s.length()/2)*2;

string a;

cin>>a;

for(int i=0;

i