看代码:
#include<ctype.h>#include<stdio.h>#include <iostream>using namespace std;int main(void){ char ch; int total; total=0;//初始化 /*统计字母块*/ do{ ch=getchar(); if(isalpha(ch)!=0) total++; }while(ch!='.');//结束符号为 . printf("The total of letters is %d n",total); return 0;}所以输入输出大概如下:
输入:123456+1s输出:The total of letters is 1因为只有s是数字。