字符串处理的常见问题

来源:互联网 发布:淘宝虚拟物品记录 编辑:程序博客网 时间:2024/06/06 02:53
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的个数
0 0