当前位置:网站首页>[string] palindrome string of codeup
[string] palindrome string of codeup
2022-07-06 05:37:00 【Moliay】
Title Description
Read in a string of characters , Determine whether it is a palindrome string .“ Palindrome string ” It's a string that is read both forward and backward , such as “level” perhaps “noon” And so on are palindrome strings .
Input
One line string , Length not exceeding 255.
Output
If it's a palindrome string , Output “YES”, Otherwise output “NO”.
The sample input Copy
12321
Sample output Copy
YES
solution
#include <stdio.h>
#include <string.h>
int main(){
char m[256];
scanf("%s", m);
int l = strlen(m), i;
for(i = 0; i < l / 2; i++){
if(m[i] != m[l - i - 1]){
printf("NO");
break;
}
}
if(i >= l / 2)
printf("YES");
return 0;
}
边栏推荐
- Deep learning -yolov5 introduction to actual combat click data set training
- jdbc使用call调用存储过程报错
- 应用安全系列之三十七:日志注入
- Pix2pix: image to image conversion using conditional countermeasure networks
- [mask requirements of OSPF and Isis in multi access network]
- 01. 开发博客项目之项目介绍
- 无代码六月大事件|2022无代码探索者大会即将召开;AI增强型无代码工具推出...
- Pointer classic written test questions
- [SQL Server Express Way] - authentification et création et gestion de comptes utilisateurs
- Solution of QT TCP packet sticking
猜你喜欢
RustDesk 搭建一个自己的远程桌面中继服务器
Sword finger offer II 039 Maximum rectangular area of histogram
Can the feelings of Xi'an version of "Coca Cola" and Bingfeng beverage rush for IPO continue?
The digital economy has broken through the waves. Is Ltd a Web3.0 website with independent rights and interests?
Promise summary
59. Spiral matrix
02. 开发博客项目之数据存储
数字经济破浪而来 ,LTD是权益独立的Web3.0网站?
C Advanced - data storage (Part 1)
[JVM] [Chapter 17] [garbage collector]
随机推荐
【LeetCode】18、四数之和
02. 开发博客项目之数据存储
改善Jpopup以实现动态控制disable
What is independent IP and how about independent IP host?
JDBC calls the stored procedure with call and reports an error
[JVM] [Chapter 17] [garbage collector]
Application Security Series 37: log injection
The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
Check the useful photo lossless magnification software on Apple computer
03. 开发博客项目之登录
The digital economy has broken through the waves. Is Ltd a Web3.0 website with independent rights and interests?
B站刘二大人-反向传播
[imgui] unity MenuItem shortcut key
Vulhub vulnerability recurrence 67_ Supervisor
数字经济破浪而来 ,LTD是权益独立的Web3.0网站?
Fluent implements a loadingbutton with loading animation
Auto.js学习笔记17:基础监听事件和UI简单的点击事件操作
巨杉数据库再次亮相金交会,共建数字经济新时代
指针经典笔试题
B站刘二大人-线性回归 Pytorch