当前位置:网站首页>函数:计算字符串中大写字母的个数
函数:计算字符串中大写字母的个数
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
边栏推荐
- Low income from doing we media? 90% of people make mistakes in these three points
- "Gold, silver and four" job hopping needs to be cautious. Can an article solve the interview?
- How to earn the first pot of gold in CSDN (we are all creators)
- 指针--剔除字符串中的所有数字
- Windows platform mongodb database installation
- 《统计学》第八版贾俊平第八章假设检验知识点总结及课后习题答案
- 【指针】求字符串的长度
- Ucos-iii learning records (11) - task management
- A complete collection of papers on text recognition
- 《统计学》第八版贾俊平第十三章时间序列分析和预测知识点总结及课后习题答案
猜你喜欢

servlet中 servlet context与 session与 request三个对象的常用方法和存放数据的作用域。

Hackmyvm target series (1) -webmaster

1.支付系统

Intel oneapi - opening a new era of heterogeneity

xray與burp聯動 挖掘

JDBC事务、批处理以及连接池(超详细)

Low income from doing we media? 90% of people make mistakes in these three points

Realize applet payment function with applet cloud development (including source code)
![New version of postman flows [introductory teaching chapter 01 send request]](/img/0f/a41a39093a1170cc3f62075fd76182.jpg)
New version of postman flows [introductory teaching chapter 01 send request]

Statistics 8th Edition Jia Junping Chapter 7 Summary of knowledge points and answers to exercises after class
随机推荐
Applet Web Capture -fiddler
循环队列(C语言)
Spot gold prices rose amid volatility, and the rise in U.S. prices is likely to become the key to the future
Statistics 8th Edition Jia Junping Chapter 12 summary of knowledge points of multiple linear regression and answers to exercises after class
内网渗透之内网信息收集(五)
Record an edu, SQL injection practice
MySQL interview questions (4)
浙大版《C语言程序设计实验与习题指导(第3版)》题目集
WEB漏洞-文件操作之文件包含漏洞
Intranet information collection of Intranet penetration (4)
Build domain environment (win)
数据库多表链接的查询方式
Windows platform mongodb database installation
Detailed explanation of network foundation routing
New version of postman flows [introductory teaching chapter 01 send request]
Realize applet payment function with applet cloud development (including source code)
《统计学》第八版贾俊平第五章概率与概率分布
《统计学》第八版贾俊平第十四章指数知识点总结及课后习题答案
Hackmyvm target series (7) -tron
Statistics 8th Edition Jia Junping Chapter 3 after class exercises and answer summary