怎么统计字符串中的字符个数,不包含空格换行符(初学者C++)
2条回答 默认 最新
fuill 2021-12-24 00:18关注#include<stdio.h> int main() { char ch[150]; scanf("%s",ch); int i=0; while(ch[i]!='\0') { // printf("%c\n",ch[i]); i++; } printf("\n%d\n",i); return 0; }本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报