99+木头的博客&
Enjoy writing code.

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

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

 

[代码(AC)]

 

 1 #include <iostream>
 2 #include <cstdio>
 3 #include <cmath>
 4 #include <string>
 5 #include <cstring>
 6 #include <algorithm>
 7 using namespace std;
 8 char s[100];
 9 int main (){
10     gets(s);
11     int len=strlen(s);
12     int ans=0;
13     for(int i=0;i<len;++i){
14         if(s[i]!=' '&&s[i]!='\n')++ans;
15     }
16     printf("%d",ans);
17     return 0;
18 }

 2018-11-18 10:13:03

posted @ 2018-11-18 10:09  99+木头  阅读(812)  评论(0编辑  收藏  举报