首页 > 编程知识 正文

c语言isalpha函数用法,c++isalpha

时间:2023-05-06 04:49:19 阅读:273418 作者:1222

看代码:

#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是数字。

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。