快乐在明天


私信TA

用户名:dotcpp0598211

访问量:1377

签 名:

等  级
排  名 472
经  验 4567
参赛次数 0
文章发表 14
年  龄 0
在职情况 学生
学  校
专  业

  自我简介:

TA的其他文章

解题思路:

注意事项:

参考代码:

#include<iostream>

#include <bits/stdc++.h> 

using namespace std;

int main(){

  char s[100];

  gets(s);

  int len1=strlen(s);

  int a1=0,b1=0,c1=0,d1=0;

  cout<<s.length()<<endl;

  for(int i=0;i<len1;i++)

      {

          if((s[i]>='a'&&s[i]<='z')||(s[i]>='A'&&s[i]<='Z'))

           a1++;

          else if(s[i]>='0'&&s[i]<='9')

           b1++;

          else if(s[i]==' ')

           c1++;

          else

           d1++;

      }

      cout<<a1<<" "<<b1<<" "<<c1<<" "<<d1;

  }


 

0.0分

0 人评分

看不懂代码?想转换其他语言的代码? 或者想问其他问题? 试试问问AI编程助手,随时响应你的问题:

编程语言转换

万能编程问答

代码解释器

  评论区