#include<stdio.h>
#include<math.h>
#include<string>
int main()
{
//案例二
int count=0;
char c;
printf("请输入一串字符:\n");
c=getchar();
while(c!='\n')
{ count++;
c=getchar();
}
printf("输入字符的个数为%d\n",count);
//(简化版)
//int n = 0; //计算输入字符的个数(用while语句)
//printf("请输入一串字符:\n");
//while (getchar() != '\n')
//{
// n++;
//}
//printf("输入字符的个数为%d\n", n);
return 0;
};