demo 1
修改while语句
while (cin>>word) {
count++;
length += word.length();
}
demo 2
将 if((cin>>word)==0) 修改为
if( !(cin>>word))
发生错误的原因:
因为VS对语法要求更严,高版本的VS不能直接或邻近比较。
demo 1
修改while语句
while (cin>>word) {
count++;
length += word.length();
}
demo 2
将 if((cin>>word)==0) 修改为
if( !(cin>>word))
发生错误的原因:
因为VS对语法要求更严,高版本的VS不能直接或邻近比较。