第22470题 单选题
在给定的C++代码中,实现字符串中26个字母个数统计的横线处应填入的代码是?

代码截图

string str="HELLO CHEN A DAI";
int strlen=str.length();
char alpha[26]={65};
int cnt[26]={0};
for(int i=1;i<26;i++)
{
    ________________________;
}
for(int i=0;i<26;i++)
{
    cout<<alpha[i]<<" ";
}
cout<<endl;
for(int i=0;i<26;i++)
{
    for(int j=0;j<strlen;j++)
    {
        if(alpha[i]==str[j])
        {
            cnt[i]++;
        }
    }
}
for(int i=0;i<26;i++)
{
    cout<<cnt[i]<<" ";
}
{{ option.label }}
子题{{ index + 1 }} {{ child.type_label }}
{{ option.label }}
✓ 正确 ◐ 部分正确 ✗ 错误
程序运行统计
暂无判题统计
提交{{ questionInfo.stats ? questionInfo.stats.submit_count : 0 }}次 正确率{{ statsAccuracy }}%
答案解析