编程问题

[复制链接]
查看11 | 回复2 | 2008-6-10 19:14:43 | 显示全部楼层 |阅读模式
编程:输入任一字符串:如“?*12#ab>fx48sABC "输出该字符串得大写字母与小写字母得个数

回复

使用道具 举报

千问 | 2008-6-10 19:14:43 | 显示全部楼层
#include #include#includeusing namespace std; int main() { char s[80]; gets(s); int upper,lower,number,space,other; upper=lower=number=space=other=0; char *p; for(p=s;*p;p++) { if(isupper(*p)) upper++; else if(islower(*p)) lower++; else if(isdigit(*p)) number++;
回复

使用道具 举报

千问 | 2008-6-10 19:14:43 | 显示全部楼层
#include #include void main(){int upper, lower, i;char str[100];upper = lower = 0;gets(str);//输入字符串for(i=0; str!='\0'; ++i){if(str>='a'
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行