当前位置:网站首页>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;
}
边栏推荐
- Redis redisTemplate.execute 执行锁
- labelme标注的json标签转txt格式
- 重估HR SaaS:一体化后的新三年
- CST Studio Suite 2021软件安装包和安装教程
- 深入理解Aarch64内存管理
- 基于FPGA的任意字节数的串口接收(含源码工程)
- Project (7) - PolarSeg point cloud semantic segmentation
- How to activate the payment function on WeChat official account?
- flask——请求、响应、请求扩展、session、闪现、蓝图、g对象、flask-session
- 从TRPO到PPO(理论分析与数学证明)
猜你喜欢
随机推荐
MATLB|And her ups and downs and finally reached the peak of life [Romantic Journey]
服装店管理系统如何推送活动?
Tensor flow 踩坑记
Creo5.0 introductory tutorial free material
网络协议05 -网络层
02|运算符
win10重装系统后没声音怎么办?
C language learning journey [operator (incomplete version)]
E - Sugoroku 3(期望dp)
[NCTF2019]True XML cookbook-1|XXE漏洞
【数据存储】signed,unsigned到底怎么区分?如何计算?
-向量点积-
-Knight Parade-
阿雷的血压有些低
字节技术面都过了,薪资都谈好了20K*13结果还是被刷了,问HR原因是。。。
有PEG-Biotin参与的(CAS:1778736-18-7)Biotin-PEG4-OH广泛用于分子靶点检测
构建平衡二叉树「建议收藏」
【问题解决】训练和验证准确率很高,但测试准确率很低
WPF DataGrid using data templates
深入理解Aarch64内存管理