[题解]NOIP2018(普及组)T1标题统计(title)

时间:2021-09-04 19:14:27

NOIP2018(普及组)T1标题统计(title) 题解

[题解]NOIP2018(普及组)T1标题统计(title)

[代码(AC)]

 #include <iostream>
#include <cstdio>
#include <cmath>
#include <string>
#include <cstring>
#include <algorithm>
using namespace std;
char s[];
int main (){
gets(s);
int len=strlen(s);
int ans=;
for(int i=;i<len;++i){
if(s[i]!=' '&&s[i]!='\n')++ans;
}
printf("%d",ans);
return ;
}

2018-11-18 10:13:03