当前位置:网站首页>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;
}
边栏推荐
猜你喜欢
pytest:如何在测试中编写和报告断言
网络协议05 -网络层
Win7怎么把控制面板添加到右键菜单
3.9 - 正规表达式和正规集 3.10 - 有限自动机
组件传值-作用域插槽
如何抑制告警风暴?
快速响应性智能型/智能响应性聚乙二醇纳米/还原响应型水凝胶的研究与制备
程序员从佩洛西窜访事件中可以学到什么?
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...
openEuler 知:abi 检测
随机推荐
第十五章 mysql存储过程与存储函数课后练习
分形网络(FractalNet)----学习笔记
《痞子衡嵌入式半月刊》 第 60 期
Kubernetes 开发环境比对
【问题解决】训练和验证准确率很高,但测试准确率很低
Win7怎么把控制面板添加到右键菜单
[SUCTF 2019]CheckIn (.htaccess和.user.ini)
What should I do if there is no sound after reinstalling the system in win10?
Impala 疑问
阿里云混合云管理平台多Region架构
Redisson 分布式锁
Leetcode81. 搜索旋转排序数组 II
网络协议05 -网络层
Leetcode82. 删除排序链表中的重复元素 II
Leetcode80. 删除有序数组中的重复项 II
Today's sleep quality record 61 points
nfs配置
Tensor flow 踩坑记
router路由
Redis 非关系型数据库学习(一) ---- Redis 的安装