当前位置:网站首页>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;
}
边栏推荐
猜你喜欢
随机推荐
hql语言
由生物素参与的D-Biotinol,CAS号:53906-36-8具体特性说明
nfs配置
MATLB|和她跌宕起伏最终到达人生之峰【浪漫旅途】
字节技术面都过了,薪资都谈好了20K*13结果还是被刷了,问HR原因是。。。
【obs】obsqsv11 硬编 及与metartc codec对比
router路由
CAS:851113-28-5 (生物素-ahx-ahx-酪胺)
2022金九银十工作潮,怎么样才能成功跳槽面试拿到高薪呢?
3.9 - 正规表达式和正规集 3.10 - 有限自动机
const修饰指针的三种情况
CAS:183896-00-6 (Biotin-PEG3-C3-NH2) PEG derivative
程序员从佩洛西窜访事件中可以学到什么?
快速响应性智能型/智能响应性聚乙二醇纳米/还原响应型水凝胶的研究与制备
c语言文件基本操作总结
【「收藏」Oracle 数据库安装】
JVM Memory and Garbage Collection - 10. Direct Memory
MATLB|And her ups and downs and finally reached the peak of life [Romantic Journey]
无源晶振负载电容值CL匹配方法及说明
走出迷宫的最少步数2