while循环,统计从键盘输入一行字符的个数 //统计从键盘输入一行字符的个数#include <stdio.h>void main() { int n = 0; printf("input a string:\n"); while (getchar() != '\n') { n++; } printf("%d", n);} C语言 2023-06-12 61 点赞 0 评论 92 浏览