原本我的输入部分是这样的:
inline void INIT()
{
tmp = getchar();
while (tmp != EOF)
{
bin[++p] = atn(tmp);
if(bin[p] <= bin[p-1])
{
printf("0");
return 0;
}
tmp = getchar();
}
}
结果:10pts
跑了十分钟对拍无果后我才想到了题目输入存在换行符、空格及其他字符的可能
于是改成了这样:
inline void INIT()
{
tmp = getchar();
while(tmp > 96 && tmp < 123)
{
bin[++p] = atn(tmp);
if(bin[p] <= bin[p-1])
{
printf("0");
return 0;
}
tmp = getchar();
}
}
终于AC
出题人也确实没说输入只含字母