当前位置:网站首页>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;
}
边栏推荐
猜你喜欢
随机推荐
游泳馆系统次卡的设置有哪些细节?
字节技术面都过了,薪资都谈好了20K*13结果还是被刷了,问HR原因是。。。
[obs] obsqsv11 hard coding and comparison with metartc codec
c语言指针练习题
阿雷的血压有些低
C语言学习之旅 【操作符(残缺版)】
深入理解Aarch64内存管理
【数据存储】signed,unsigned到底怎么区分?如何计算?
Stanford CS143 速通PA1教程
E - Sugoroku 3(期望dp)
【CAS:41994-02-9 |Biotinyl tyramide】生物素基酪氨酰胺价格
How to turn off system protection in Win11?How to turn off the system protection restore function?
Today's sleep quality record 61 points
dlopen failed: library “libtaml.so“ not found
安全知识培训——消防安全
从TRPO到PPO(理论分析与数学证明)
移动终端数据业务高安全通信方案研究
flask——请求、响应、请求扩展、session、闪现、蓝图、g对象、flask-session
无源晶振负载电容值CL匹配方法及说明
为什么不建议你在 Docker 中跑 Mysql ?









