当前位置:网站首页>Judge whether a string is a full letter sentence
Judge whether a string is a full letter sentence
2022-07-05 17:05:00 【Daily study of bald girls】
Judge whether a string is a full letter sentence
LeetCode Day 2
subject : Give a string consisting of only lowercase English letters sentence , Judge sentence Is it a full letter sentence . If it is , return true ; otherwise , return false .
Topic link :https://leetcode-cn.com/problems/check-if-the-sentence-is-pangram/
Full letter sentence : A sentence contains each letter of the English alphabet at least once .
Implementation code :
#include<stdio.h>
#include<string.h>
bool checkIfPangram(char * sentence)
{
char zimu[30]={
0};
int i,j,length;
length=strlen(sentence);
for(i=0;i<length;i++)
{
zimu[sentence[i]-'a']++;
}
for(j=0;j<26;j++)
{
if(zimu[j]==0)
return false;
}
return true;
}
int main()
{
char senten[1005];
scanf("%s",&senten);
bool flag = checkIfPangram(senten);
printf("%d",flag);
}
Running results :
Not all alphabetic sentences , Output 0
It's a full alphabetic sentence , Output 1
边栏推荐
- [Jianzhi offer] 61 Shunzi in playing cards
- [Web attack and Defense] WAF detection technology map
- 阈值同态加密在隐私计算中的应用:解读
- Iphone14 with pill screen may trigger a rush for Chinese consumers
- Keras crash Guide
- File operation --i/o
- 【性能测试】jmeter+Grafana+influxdb部署实战
- Jarvis OJ shell traffic analysis
- Yarn common commands
- The first EMQ in China joined Amazon cloud technology's "startup acceleration - global partner network program"
猜你喜欢
Error in composer installation: no composer lock file present.
【剑指 Offer】63. 股票的最大利润
Keras crash Guide
Embedded -arm (bare board development) -1
Jarvis OJ Webshell分析
Copy mode DMA
ECU简介
Get ready for the pre-season card game MotoGP ignition champions!
拷贝方式之DMA
Cs231n notes (bottom) - applicable to 0 Foundation
随机推荐
什么是ROM
腾讯音乐上线新产品“曲易买”,提供音乐商用版权授权
【jmeter】jmeter脚本高级写法:接口自动化脚本内全部为变量,参数(参数可jenkins配置),函数等实现完整业务流测试
【剑指 Offer】66. 构建乘积数组
Jarvis OJ Webshell分析
[team PK competition] the task of this week has been opened | question answering challenge to consolidate the knowledge of commodity details
Solution of vant tabbar blocking content
Copy mode DMA
精准防疫有“利器”| 芯讯通助力数字哨兵护航复市
Twig数组合并的写法
[61dctf]fm
[brush title] goose factory shirt problem
Games101 notes (II)
通过proc接口调试内核代码
C how TCP restricts the access traffic of a single client
Apple has abandoned navigationview and used navigationstack and navigationsplitview to implement swiftui navigation
Is it safe to open an account for digging wealth stocks? How is it safe to open a stock account?
齐宣王典故
飞桨EasyDL实操范例:工业零件划痕自动识别
中国广电正式推出5G服务,中国移动赶紧推出免费服务挽留用户