32:行程长度编码
http://noi.openjudge.cn/ch0107/32/
#include
using namespace std;
int main()
{
string s;
getline(cin,s);
s=strupr(const_cast<char *>(s.c_str()));
{
char d=s[i];
for(int g=1;;g++)
{
if(s[i+g]!=d)
{
cout<<'('<','<')';
i+=g-1;
break;
}
}
}
return 0;
}
试运行没问题,但在openjudge上:
error: ‘strupr’ was not declared in this scope; did you mean ‘strstr’?
有看到这个,可能是用不了的原因
兼容性说明:strupr不是标准C库函数,只能在VC中使用。在linux gcc环境下需要自行定义这个函数。