PJJ彭彭彭


私信TA

用户名:PJJ1997

访问量:55739

签 名:

试试单纯的暴力能暴到多少题

等  级
排  名 46
经  验 11324
参赛次数 10
文章发表 91
年  龄 20
在职情况 学生
学  校 广东药科大学
专  业 计算机科学与技术

  自我简介:

TA的其他文章

解题思路:





注意事项:





参考代码:

#include <iostream>

#include <deque>

#include <algorithm>

#include <numeric>

#include <iterator>

#include <string>

#include <cmath>

#include <cstdlib>

#include <string.h>

using namespace std;

int a[26];

int main()

{

char ch;

while((ch=cin.get())!='#')

{

if(ch=='\n'||ch==' ')

{

continue;

}

else if(ch=='a')

{

a[0]++;

}

else if(ch=='b')

{

a[1]++;

}

else if(ch=='c')

{

a[2]++;

}

else if(ch=='d')

{

a[3]++;

}

else if(ch=='e')

{

a[4]++;

}

else if(ch=='f')

{

a[5]++;

}

else if(ch=='g')

{

a[6]++;

}

else if(ch=='h')

{

a[7]++;

}

else if(ch=='i')

{

a[8]++;

}

else if(ch=='j')

{

a[9]++;

}

else if(ch=='k')

{

a[10]++;

}

else if(ch=='l')

{

a[11]++;

}

else if(ch=='m')

{

a[12]++;

}

else if(ch=='n')

{

a[13]++;

}

else if(ch=='o')

{

a[14]++;

}

else if(ch=='p')

{

a[15]++;

}

else if(ch=='q')

{

a[16]++;

}

else if(ch=='r')

{

a[17]++;

}

else if(ch=='s')

{

a[18]++;

}

else if(ch=='t')

{

a[19]++;

}

else if(ch=='u')

{

a[20]++;

}

else if(ch=='v')

{

a[21]++;

}

else if(ch=='w')

{

a[22]++;

}

else if(ch=='x')

{

a[23]++;

}

else if(ch=='y')

{

a[24]++;

}

else if(ch=='z')

{

a[25]++;

}

}

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

{

printf("%c %d\n",'a'+i,a[i]);

}

return 0;

}


 


 

0.0分

0 人评分

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

编程语言转换

万能编程问答  

代码解释器

代码纠错

SQL生成与解释

  评论区