测评会员优惠活动进行中 · 开通 VIP,有效期内测评不限次 VIP 优惠中 · 测评不限次 立即查看

A23512. #include<iostream> #include<string> using namespace std; char s[10000]; int cnt[200]; int main(){ scanf("%s",s); for(int i=0;i<strlen(s);i++){ if(s[i]>=48&&s[i]<=57&&cnt[s[i]-48]<=10){ s[strlen(s)]=s…

判断题 较易

题目描述

#include<iostream>
#include<string>
using namespace std;
char s[10000];
int cnt[200];
int main(){
    scanf("%s",s);
    for(int i=0;i<strlen(s);i++){
        if(s[i]>=48&&s[i]<=57&&cnt[s[i]-48]<=10){
            s[strlen(s)]=s[i];
        }
        cnt[s[i]-48]++;
    }
    printf("%s\n",s);
    return 0;
}
假设输入的字符串长度不超过 50 且只包含数字和小写字母,完成下面的判断题

因为输入字符串长度不超过 50,故第 4 行的 10000 改成 100,程序运行结果不变。(    )

选项(单选)

上一题 下一题