当前位置:网站首页>函数:计算字符串中大写字母的个数
函数:计算字符串中大写字母的个数
2022-07-06 09:24:00 【|光|】
要求
编一个名为countc函数,要求如下:
形式参数:array 存放字符串的字符型数组名
功能: 统计array数组中大写字母的数目
返回值: 字符串中大写字母的数目
代码
#include<string.h>
/* *在该函数中实现对字符串中的大写字母的统计 */
int countc(char a[])
{
int sum=0;
int i;
for(i=0;i<100;i++)
{
if(a[i]=='\0')
break;
else if(a[i]>='A'&&a[i]<='Z')
sum = sum+1;
}
return sum;
}
测试
测试输入
dfaDASFA4rdfsFDGSdfsgh
输出
大写字母个数为9
边栏推荐
- 我的第一篇博客
- Mysql的事务是什么?什么是脏读,什么是幻读?不可重复读?
- Data mining - a discussion on sample imbalance in classification problems
- 内网渗透之内网信息收集(四)
- xray与burp联动 挖掘
- 2022华中杯数学建模思路
- Spot gold prices rose amid volatility, and the rise in U.S. prices is likely to become the key to the future
- 关于超星脚本出现乱码问题
- 网络层—简单的arp断网
- Statistics, 8th Edition, Jia Junping, Chapter 11 summary of knowledge points of univariate linear regression and answers to exercises after class
猜你喜欢

sqqyw(淡然点图标系统)漏洞复现和74cms漏洞复现

Intranet information collection of Intranet penetration (2)

图书管理系统

《统计学》第八版贾俊平第六章统计量及抽样分布知识点总结及课后习题答案
![Harmonyos application development -- address book management system telmanagesys based on listcontainer [phonebook][api v6]](/img/0b/ddbee0b8a34627e13bff5598bbaed8.jpg)
Harmonyos application development -- address book management system telmanagesys based on listcontainer [phonebook][api v6]

Data mining - a discussion on sample imbalance in classification problems

Wei Shen of Peking University revealed the current situation: his class is not very good, and there are only 5 or 6 middle-term students left after leaving class

Hcip -- MPLS experiment
![[paper reproduction] cyclegan (based on pytorch framework) {unfinished}](/img/16/43d8929d1a37c1c68e959d5854e18c.jpg)
[paper reproduction] cyclegan (based on pytorch framework) {unfinished}

MySQL中什么是索引?常用的索引有哪些种类?索引在什么情况下会失效?
随机推荐
《統計學》第八版賈俊平第七章知識點總結及課後習題答案
sqqyw(淡然点图标系统)漏洞复现和74cms漏洞复现
Captcha killer verification code identification plug-in
XSS unexpected event
Intranet information collection of Intranet penetration (4)
Intranet information collection of Intranet penetration (5)
内网渗透之内网信息收集(二)
Résumé des points de connaissance et des réponses aux exercices après la classe du chapitre 7 de Jia junping dans la huitième édition des statistiques
图书管理系统
Hackmyvm target series (5) -warez
Intranet information collection of Intranet penetration (I)
[err] 1055 - expression 1 of order by clause is not in group by clause MySQL
Record once, modify password logic vulnerability actual combat
Harmonyos application development -- address book management system telmanagesys based on listcontainer [phonebook][api v6]
Which is more advantageous in short-term or long-term spot gold investment?
关于超星脚本出现乱码问题
Intranet information collection of Intranet penetration (2)
Statistics 8th Edition Jia Junping Chapter 3 after class exercises and answer summary
内网渗透之内网信息收集(三)
攻防世界MISC练习区(SimpleRAR、base64stego、功夫再高也怕菜刀)