当前位置:网站首页>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
边栏推荐
- Deep learning plus
- [team PK competition] the task of this week has been opened | question answering challenge to consolidate the knowledge of commodity details
- [61dctf]fm
- 采用药丸屏的iPhone14或引发中国消费者的热烈抢购
- 【剑指 Offer】61. 扑克牌中的顺子
- 叩富网开期货账户安全可靠吗?怎么分辨平台是否安全?
- Embedded -arm (bare board development) -1
- 麻烦问下,DMS中使用Redis语法是以云数据库Redis社区版的命令为参考的嘛
- Explain in detail the functions and underlying implementation logic of the groups sets statement in SQL
- 帮忙看看是什么问题可以吗?[ERROR] Could not execute SQL stateme
猜你喜欢

Keras crash Guide

The two ways of domestic chip industry chain go hand in hand. ASML really panicked and increased cooperation on a large scale

采用药丸屏的iPhone14或引发中国消费者的热烈抢购

Hiengine: comparable to the local cloud native memory database engine

Deep dive kotlin synergy (XXI): flow life cycle function

Jarvis OJ 简单网管协议

Machine learning compilation lesson 2: tensor program abstraction

Fleet tutorial 09 basic introduction to navigationrail (tutorial includes source code)

The survey shows that the failure rate of traditional data security tools in the face of blackmail software attacks is as high as 60%
![[Jianzhi offer] 63 Maximum profit of stock](/img/b6/c1dec97a23ac13aa53d1d202b83ef5.png)
[Jianzhi offer] 63 Maximum profit of stock
随机推荐
Jarvis OJ Webshell分析
sqlserver 做cdc 要对数据库性能有什么要求么
Jarvis OJ 简单网管协议
Embedded-c language-6
Twig数组合并的写法
Binary tree related OJ problems
Error in composer installation: no composer lock file present.
Get ready for the pre-season card game MotoGP ignition champions!
Sentinel flow guard
Deep learning plus
【剑指 Offer】66. 构建乘积数组
SQL injection of cisp-pte (Application of secondary injection)
Detailed explanation of use scenarios and functions of polar coordinate sector diagram
PHP strict mode
Deep dive kotlin synergy (XXI): flow life cycle function
【性能测试】全链路压测
thinkphp模板的使用
Allusions of King Xuan of Qi Dynasty
Thoughtworks 全球CTO:按需求构建架构,过度工程只会“劳民伤财”
Is it safe to open futures accounts online? Will there be more liars online? Doesn't feel very reliable?