当前位置:网站首页>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
边栏推荐
- 挖财股票开户安全吗?怎么开股票账户是安全?
- Learnopongl notes (I)
- tf. sequence_ Mask function explanation case
- The first lesson of EasyX learning
- Scratch colorful candied haws Electronic Society graphical programming scratch grade examination level 3 true questions and answers analysis June 2022
- PHP strict mode
- 拷贝方式之DMA
- Hiengine: comparable to the local cloud native memory database engine
- Embedded UC (UNIX System Advanced Programming) -1
- Deep learning plus
猜你喜欢
![[61dctf]fm](/img/22/3e4e3f1679a27d8b905684bb709905.png)
[61dctf]fm

Embedded-c Language-2

Games101 notes (III)

【性能测试】jmeter+Grafana+influxdb部署实战

Jarvis OJ 远程登录协议

If you can't afford a real cat, you can use code to suck cats -unity particles to draw cats

Error in composer installation: no composer lock file present.

Flet tutorial 12 stack overlapping to build a basic introduction to graphic and text mixing (tutorial includes source code)

【jmeter】jmeter脚本高级写法:接口自动化脚本内全部为变量,参数(参数可jenkins配置),函数等实现完整业务流测试

Machine learning compilation lesson 2: tensor program abstraction
随机推荐
Iphone14 with pill screen may trigger a rush for Chinese consumers
C# TCP如何设置心跳数据包,才显得优雅呢?
Use byte stream to read Chinese from file to console display
npm安装
Basic introduction to the control of the row component displaying its children in the horizontal array (tutorial includes source code)
精准防疫有“利器”| 芯讯通助力数字哨兵护航复市
Combined use of vant popup+ other components and pit avoidance Guide
国产芯片产业链两条路齐头并进,ASML真慌了而大举加大合作力度
How does the outer disk futures platform distinguish formal security?
C# TCP如何限制单个客户端的访问流量
干货!半监督预训练对话模型 SPACE
[Web attack and Defense] WAF detection technology map
WSL2.0安装
时间戳strtotime前一天或后一天的日期
Browser rendering principle and rearrangement and redrawing
Explain in detail the functions and underlying implementation logic of the groups sets statement in SQL
Etcd 构建高可用Etcd集群
Error in composer installation: no composer lock file present.
Raspberry pie 4B installation pytorch1.11
启牛商学院股票开户安全吗?靠谱吗?