当前位置:网站首页>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
边栏推荐
- Ucos-iii learning records (11) - task management
- 《统计学》第八版贾俊平第一章课后习题及答案总结
- XSS之冷门事件
- New version of postman flows [introductory teaching chapter 01 send request]
- JVM memory model concept
- 【指针】求二维数组中最大元素的值
- 使用 flask_whooshalchemyplus jieba实现flask的全局搜索
- Hackmyvm target series (1) -webmaster
- 数字电路基础(一)数制与码制
- Mathematical modeling idea of 2022 central China Cup
猜你喜欢
数字电路基础(五)算术运算电路
内网渗透之内网信息收集(三)
Xray and burp linkage mining
Wu Enda's latest interview! Data centric reasons
Ucos-iii learning records (11) - task management
WEB漏洞-文件操作之文件包含漏洞
captcha-killer验证码识别插件
Attack and defense world misc practice area (GIF lift table ext3)
JDBC看这篇就够了
Data mining - a discussion on sample imbalance in classification problems
随机推荐
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
servlet中 servlet context与 session与 request三个对象的常用方法和存放数据的作用域。
浅谈漏洞发现思路
Intranet information collection of Intranet penetration (5)
【指针】八进制转换为十进制
Internet Management (Information Collection)
安全面试之XSS(跨站脚本攻击)
Sqqyw (indifferent dot icon system) vulnerability recurrence and 74cms vulnerability recurrence
《英特尔 oneAPI—打开异构新纪元》
内网渗透之内网信息收集(四)
SQL injection
The difference between layer 3 switch and router
Detailed explanation of network foundation routing
5分钟掌握机器学习鸢尾花逻辑回归分类
【指针】求解最后留下的人
Mysql的事务是什么?什么是脏读,什么是幻读?不可重复读?
Statistics 8th Edition Jia Junping Chapter 14 summary of index knowledge points and answers to exercises after class
How does SQLite count the data that meets another condition under the data that has been classified once
Feature extraction and detection 14 plane object recognition
Applet Web Capture -fiddler