当前位置:网站首页>Function: calculates the number of uppercase letters in a string
Function: calculates the number of uppercase letters in a string
2022-07-06 14:35:00 【|Light|】
requirement
Make up a name countc function , Requirements are as follows :
Formal parameters :array The character array name of the string
function : Statistics array The number of uppercase letters in the array
Return value : The number of uppercase letters in the string
Code
#include<string.h>
/* * In this function, you can count the uppercase letters in the string */
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;
}
test
Test input
dfaDASFA4rdfsFDGSdfsgh
Output
The number of capital letters is 9
边栏推荐
- Load balancing ribbon of microservices
- Attack and defense world misc practice area (GIF lift table ext3)
- c语言学习总结(上)(更新中)
- Data mining - a discussion on sample imbalance in classification problems
- Feature extraction and detection 14 plane object recognition
- Statistics, 8th Edition, Jia Junping, Chapter 11 summary of knowledge points of univariate linear regression and answers to exercises after class
- 《统计学》第八版贾俊平第六章统计量及抽样分布知识点总结及课后习题答案
- 1.支付系统
- 《统计学》第八版贾俊平第三章课后习题及答案总结
- 我的第一篇博客
猜你喜欢
MySQL中什么是索引?常用的索引有哪些种类?索引在什么情况下会失效?
《统计学》第八版贾俊平第四章总结及课后习题答案
《统计学》第八版贾俊平第十章方差分析知识点总结及课后习题答案
JDBC看这篇就够了
Intranet information collection of Intranet penetration (4)
内网渗透之内网信息收集(五)
Lintcode logo queries the two nearest saplings
《统计学》第八版贾俊平第八章假设检验知识点总结及课后习题答案
sqqyw(淡然点图标系统)漏洞复现和74cms漏洞复现
Applet Web Capture -fiddler
随机推荐
Interview Essentials: what is the mysterious framework asking?
Low income from doing we media? 90% of people make mistakes in these three points
{1,2,3,2,5}查重问题
“人生若只如初见”——RISC-V
Sqqyw (indifferent dot icon system) vulnerability recurrence and 74cms vulnerability recurrence
Network layer - simple ARP disconnection
内网渗透之内网信息收集(三)
[err] 1055 - expression 1 of order by clause is not in group by clause MySQL
函数:求两个正数的最大公约数和最小公倍
Lintcode logo queries the two nearest saplings
How to test whether an object is a proxy- How to test if an object is a Proxy?
Only 40% of the articles are original? Here comes the modification method
1.支付系统
MySQL learning notes (stage 1)
Apache APIs IX has the risk of rewriting the x-real-ip header (cve-2022-24112)
High concurrency programming series: 6 steps of JVM performance tuning and detailed explanation of key tuning parameters
Bing Dwen Dwen official NFT blind box will be sold for about 626 yuan each; JD home programmer was sentenced for deleting the library and running away; Laravel 9 officially released | Sifu weekly
《统计学》第八版贾俊平第九章分类数据分析知识点总结及课后习题答案
《統計學》第八版賈俊平第七章知識點總結及課後習題答案
浅谈漏洞发现思路