当前位置:网站首页>-Chess game-
-Chess game-
2022-08-10 01:47:00 【-JMY-】
Title description
The two students played n games of chess (3<=n<=9, and n is an odd number), their entry numbers are 10 and 20, and each game has a student who wins (that is, there is no tie), which student finally wonvictory?
Enter
In line 1 there is an integer n, which represents the competitionnumber of times.
Line 2 has n integers (the nThe integer must be 10 or 20, representing the entry number of the winning student).
Output
Output the entry number of the winning classmate.
Sample input
510 10 20 10 20
Sample output
10
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
if(t[a[i]]>maxn){
maxn=t[a[i]];
k=a[i];
}
}
printf("%d",k);
return 0;
}
边栏推荐
猜你喜欢
随机推荐
const修饰指针的三种情况
输入的这些数是否对称
漫谈缺陷管理的自动化实践方案
ETCD快速入门-02 ETCD安装
MATLB|和她跌宕起伏最终到达人生之峰【浪漫旅途】
Kubernetes服务接入Istio
3.4 - 编译与解释 3.5 - 编译过程 3.8 - 文法
《痞子衡嵌入式半月刊》 第 60 期
Web性能测试模型小结
arm-4-裸板开发
How to turn off system protection in Win11?How to turn off the system protection restore function?
-Knight Parade-
Leetcode81. 搜索旋转排序数组 II
Creo5.0 introductory tutorial free material
-Vector Dot Product-
【数据存储】signed,unsigned到底怎么区分?如何计算?
最高月薪15K,谁有历经千辛万苦的意志,谁就能收获属于自己的成功~
vmware Exsi 网卡配置
Docker interview question 2--get the number of database connections and docker-compose
断开和服务器共享连接的方法「建议收藏」









