码迷,mamicode.com
首页 > 其他好文 > 详细

P5015 标题统计

时间:2019-04-07 21:59:26      阅读:137      评论:0      收藏:0      [点我收藏+]

标签:标题   back   main   tar   for   字符   name   cout   https   

P5015 标题统计

‘   ’ 不等于空格,空格是个字符

 

 

代码:

#include<iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<cstring>
using namespace std;
int main()
{
    char a[100];
gets(a); //可以读入整行字符串
int len=strlen(a);
int m=len; //防止在检查过程中len被更改
for(int i=0;i<=len;i++) { if(a[i]== ) m--; //不计“ ”数目 }
cout
<<m; return 0; }

 

P5015 标题统计

标签:标题   back   main   tar   for   字符   name   cout   https   

原文地址:https://www.cnblogs.com/xiaoyezi-wink/p/10427566.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!