当前位置:网站首页>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
边栏推荐
- High number | summary of calculation methods of volume of rotating body, double integral calculation of volume of rotating body
- Precision epidemic prevention has a "sharp weapon" | smart core helps digital sentinels escort the resumption of the city
- Google Earth Engine(GEE)——Kernel核函数简单介绍以及灰度共生矩阵
- Jarvis OJ Telnet Protocol
- 7.Scala类
- Hiengine: comparable to the local cloud native memory database engine
- Jarvis OJ webshell analysis
- [Jianzhi offer] 63 Maximum profit of stock
- Copy mode DMA
- 齐宣王典故
猜你喜欢
ECU简介
Embedded-c Language-1
Precision epidemic prevention has a "sharp weapon" | smart core helps digital sentinels escort the resumption of the city
中国广电正式推出5G服务,中国移动赶紧推出免费服务挽留用户
ECU introduction
Embedded-c Language-2
[Jianzhi offer] 63 Maximum profit of stock
调查显示传统数据安全工具面对勒索软件攻击的失败率高达 60%
【 brosser le titre 】 chemise culturelle de l'usine d'oies
Solve cmakelist find_ Package cannot find Qt5, ECM cannot be found
随机推荐
[first lecture on robot coordinate system]
Embedded-c language-6
国产芯片产业链两条路齐头并进,ASML真慌了而大举加大合作力度
Fleet tutorial 09 basic introduction to navigationrail (tutorial includes source code)
[Jianzhi offer] 63 Maximum profit of stock
Error in composer installation: no composer lock file present.
sqlserver 做cdc 要对数据库性能有什么要求么
飞桨EasyDL实操范例:工业零件划痕自动识别
Games101 notes (I)
Jarvis OJ Webshell分析
Games101 notes (III)
Get ready for the pre-season card game MotoGP ignition champions!
Iphone14 with pill screen may trigger a rush for Chinese consumers
[wechat applet] read the life cycle and route jump of the applet
网上办理期货开户安全吗?网上会不会骗子比较多?感觉不太靠谱?
Binary tree related OJ problems
C language to get program running time
叩富网开期货账户安全可靠吗?怎么分辨平台是否安全?
【jmeter】jmeter脚本高级写法:接口自动化脚本内全部为变量,参数(参数可jenkins配置),函数等实现完整业务流测试
关于new Map( )还有哪些是你不知道的