[题解]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]!='
')++ans;
15     }
16     printf("%d",ans);
17     return 0;
18 }

 2018-11-18 10:13:03

原文地址:https://www.cnblogs.com/zjd-ac/p/9977103.html