题解 | #[NOIP2018]标题统计#
[NOIP2018]标题统计
https://www.nowcoder.com/practice/b14b87bc6a4547a6839e0a5867c98dba
#include <iostream>
#include <string>
using namespace std;
int main() {
string str;
// cin>>str;
int count=0;
getline(cin, str);
// cin>>str;
for(int i=0; i<str.size(); i++){
if(str[i] !=' '&& str[i] != '\n')
{
count++;
}
}
cout<<count<<endl;
return 0;
}
// 64 位输出请用 printf("%lld")
查看1道真题和解析
