tot=0;
for(i=0;i<strlen(s);i++){
if(s[i]==1){
tot++;
}
}
printf("There are %d characters(s) '1' in the string.\n",tot);
该程序的目的是统计字符串中字符1的个数
字符串处理的常见问题
最新推荐文章于 2022-09-18 10:29:42 发布
tot=0;
for(i=0;i<strlen(s);i++){
if(s[i]==1){
tot++;
}
}
printf("There are %d characters(s) '1' in the string.\n",tot);
该程序的目的是统计字符串中字符1的个数