第38306题 单选题
在如下的C++代码中实现了对字符串中出现的26个字母的个数统计,横线处应填入是( )。
string str="HELLO CHEN A DAI";
int strlen=str.length();
char alpha[26]={'A'};
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 }}%
答案解析