zhouziyang


私信TA

用户名:Yang27

访问量:1417

签 名:

等  级
排  名 552
经  验 4162
参赛次数 0
文章发表 17
年  龄 0
在职情况 学生
学  校 南海区里水镇旗峰小学
专  业

  自我简介:

#include <iostream>

#include <cstdio>

#include <cstring>

using namespace std;

int main ()

{

    char str[100];

    int alpha=0,digit=0,space=0,other=0;

    int n=100;

    gets(str);

    for(int i=0;i<strlen(str);i++){

        if (isalpha(str[i]))

        ++alpha;

        else if(isdigit(str[i]))

        ++digit;

        else if(str[i]==32)

        ++space;

        else

        ++other;

    }

    cout<<alpha<<" "<<digit<<" "<<space<<" "<<other<<endl;

    return 0;

 } 


 

0.0分

0 人评分

  评论区