当前位置:网站首页>Are the numbers entered symmetrical?
Are the numbers entered symmetrical?
2022-08-10 01:47:00 【-JMY-】
Title description
Enter an integer N from the keyboard (4<=N<=20), then input N numbers to determine whether the input numbers are symmetrical, which is the output
"YES", otherwise output "NO"?(Note that N can be odd or even).Symmetric means that the numbers are read forward and backward
It all reads the same.
For example, there are 4 numbers: 1 2 2 1,It is symmetrical. For example, there are 5 numbers: 1 2 3 2 1. It is also symmetrical, but there are 5 numbers: 1 2 3
1 2, it is not symmetrical.
Enter
Line 2 has n integers.
Output
Sample input
4
1 2 2 1
Sample output
YES
Reference code:
#include
using namespace std;
int n,a[15],t[25],maxn,k;
int main(){
scanf("%d",&n);
for(int i=0;i
for(int i=0;i
printf("NO");
return 0;
}
printf("YES");
return 0;
}
边栏推荐
- The technical aspects of the byte have been passed, and the salary has been negotiated for 20K*13, but the result is still being brushed. I asked the HR why...
- 数据的存储——C语言
- -象棋比赛-
- Leetcode81. 搜索旋转排序数组 II
- 【「收藏」Oracle 数据库安装】
- 2022金九银十工作潮,怎么样才能成功跳槽面试拿到高薪呢?
- router路由
- 程序员从佩洛西窜访事件中可以学到什么?
- c语言结构体、函数以及指针练习(简单通讯录)
- Kubernetes YAML编写 讲解
猜你喜欢
CST Studio Suite 2021软件安装包和安装教程
算法---整数替换(Kotlin)
LSTM-based distributed energy generation prediction (Matlab code implementation)
How to turn off system protection in Win11?How to turn off the system protection restore function?
WPF DataGrid using data templates
从TRPO到PPO(理论分析与数学证明)
win10重装系统后没声音怎么办?
The technical aspects of the byte have been passed, and the salary has been negotiated for 20K*13, but the result is still being brushed. I asked the HR why...
Project (7) - PolarSeg point cloud semantic segmentation
宝塔实测-搭建LightPicture开源图床系统
随机推荐
【obs】obsqsv11 硬编 及与metartc codec对比
nfs配置
win10重装系统后没声音怎么办?
const修饰指针的三种情况
C language learning journey [operator (incomplete version)]
宝塔实测-搭建LightPicture开源图床系统
安全知识培训——消防安全
第十五章 mysql存储过程与存储函数课后练习
CAS:851113-28-5 (Biotin-ahx-ahx-tyramine)
【Django】缓存
[obs] obsqsv11 hard coding and comparison with metartc codec
openEuler 知:abi 检测
算法---整数替换(Kotlin)
漫谈缺陷管理的自动化实践方案
考柏的感慨
微信公众号如何开通支付功能?
hql语言
CAS:851113-28-5 (生物素-ahx-ahx-酪胺)
flask——请求、响应、请求扩展、session、闪现、蓝图、g对象、flask-session
WPF DataGrid 使用数据模板