当前位置:网站首页>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
边栏推荐
- Network technology related topics
- Sword finger offer 23 - print binary tree from top to bottom
- 指针:最大值、最小值和平均值
- C language file operation
- Hcip -- MPLS experiment
- Statistics 8th Edition Jia Junping Chapter 7 Summary of knowledge points and answers to exercises after class
- xray與burp聯動 挖掘
- 图书管理系统
- 数字电路基础(四) 数据分配器、数据选择器和数值比较器
- 攻防世界MISC练习区(gif 掀桌子 ext3 )
猜你喜欢
记一次api接口SQL注入实战
Circular queue (C language)
《统计学》第八版贾俊平第十二章多元线性回归知识点总结及课后习题答案
Data mining - a discussion on sample imbalance in classification problems
Windows platform mongodb database installation
数据库多表链接的查询方式
Statistics, 8th Edition, Jia Junping, Chapter 11 summary of knowledge points of univariate linear regression and answers to exercises after class
Sqqyw (indifferent dot icon system) vulnerability recurrence and 74cms vulnerability recurrence
Statistics 8th Edition Jia Junping Chapter 10 summary of knowledge points of analysis of variance and answers to exercises after class
sqqyw(淡然点图标系统)漏洞复现和74cms漏洞复现
随机推荐
Intranet information collection of Intranet penetration (5)
Record once, modify password logic vulnerability actual combat
ES全文索引
【指针】查找最大的字符串
Mysql的事务是什么?什么是脏读,什么是幻读?不可重复读?
Statistics, 8th Edition, Jia Junping, Chapter 11 summary of knowledge points of univariate linear regression and answers to exercises after class
【指针】求解最后留下的人
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
2022华中杯数学建模思路
Statistics, 8th Edition, Jia Junping, Chapter VIII, summary of knowledge points of hypothesis test and answers to exercises after class
Hackmyvm target series (2) -warrior
Constants, variables, and operators of SystemVerilog usage
《统计学》第八版贾俊平第七章知识点总结及课后习题答案
flask实现强制登陆
Sword finger offer 23 - print binary tree from top to bottom
Feature extraction and detection 14 plane object recognition
Tencent map circle
Binary search tree concept
内网渗透之内网信息收集(五)
【指针】求二维数组中最大元素的值