当前位置:网站首页>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;
 }
边栏推荐
猜你喜欢
 - 02|运算符 
 - 【猜凶手,猜名次,杨辉三角】经典小学奥数的代码逻辑是什么? 
 - Win7怎么把控制面板添加到右键菜单 
![[C language] In-depth understanding of pointers and arrays (issue 4)](/img/22/ad31b47bb8cc1722121959efddefd5.png) - [C language] In-depth understanding of pointers and arrays (issue 4) 
 - The older tester has just passed the "hurdle" of being 35 years old, and I want to tell you something from my heart 
 - Creo5.0入门教程赠素材 
 - 为什么不建议你在 Docker 中跑 Mysql ? 
 - 【毕业设计】 基于Stm32的家庭智能监控系统 - 单片机 图像识别 人体检测 AI 
 - 服装店管理系统如何推送活动? 
 - 重估HR SaaS:一体化后的新三年 
随机推荐
- 2022金九银十工作潮,怎么样才能成功跳槽面试拿到高薪呢? 
- 错误提示:Syntax error on token “function”, delete this token 
- JVM Memory and Garbage Collection - 10. Direct Memory 
- -Knight Parade- 
- 移动终端数据业务高安全通信方案研究 
- 3.1 - 程序设计语言 3.2 - 高级语言的特点及引用 3.3 - 静态/动态类型语言 
- MATLB|和她跌宕起伏最终到达人生之峰【浪漫旅途】 
- Today's sleep quality record 61 points 
- 基于FPGA的任意字节数的串口接收(含源码工程) 
- 《痞子衡嵌入式半月刊》 第 60 期 
- 断开和服务器共享连接的方法「建议收藏」 
- Leecode-205. 同构字符串 
- Next.js获取路由参数及styled-jsx 的使用 
- Kubernetes 60个为什么 
- Involved in PEG-Biotin (CAS: 1778736-18-7) Biotin-PEG4-OH is widely used in molecular target detection 
- 【猜凶手,猜名次,杨辉三角】经典小学奥数的代码逻辑是什么? 
- CAS:851113-28-5 (Biotin-ahx-ahx-tyramine) 
- 从TRPO到PPO(理论分析与数学证明) 
- hql语言 
- 20220808-一些想法