【NOIP2018PJ正式赛】标题统计
暴力即可。
#include<cstdio>
#include<cstring>
using namespace std;
char ch;int ans=0;
int main()
{
freopen("title.in","r",stdin);
freopen("title.out","w",stdout);
while (scanf("%c",&ch)!=EOF)
if (ch!=' ') ans++;
printf("%d\n",ans-1);
return 0;
}
转载需注明出处。