例题已过,但是只能得10分,帮忙看看是为什么
#include<bits/stdc++.h>
using namespace std;
string text;
int num[27]={1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,4,1,2,3,1,2,3,4,1};
int main()
{ int count=0;
int lastIndex=-1;
int thisIndex=-1;
getline(cin,text);
for(int i=0;i<text.size();i++)
{
if(text[i]==' ') thisIndex=26;
if(text[i]>='a'&&text[i]<='z')
{thisIndex=text[i]-'a';
count+=num[thisIndex];
}
if(text[i]=='\r') break;
}
cout<<count;
return 0;
}