10
17
74
版主
#include<cstring> #include<cstdio> #include<iostream> using namespace std; int main() { char ch[256];int num1,num2=0; int l; gets(ch); l=strlen(ch); for(int i=0;i<l;i++) if(ch[i]>='0'&&ch[i]<='9') num1++; else num2++; cout<<"数字的个数是"<<num1<<endl; cout<<"字母的个数是"<<num2<<endl; return 0; }
使用道具 举报
本版积分规则 发表回复 回帖后跳转到最后一页
小黑屋|东台市机器人学会 ( 苏ICP备2021035350号-1;苏ICP备2021035350号-2;苏ICP备2021035350号-3 )
GMT+8, 2024-12-4 01:23 , Processed in 0.040845 second(s), 28 queries .
Powered by Discuz! X3.4
Copyright © 2001-2020, Tencent Cloud.