当前位置:网站首页>-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;
}
边栏推荐
猜你喜欢
随机推荐
3.9 - 正规表达式和正规集 3.10 - 有限自动机
【「收藏」Oracle 数据库安装】
3.11-程序基本的控制语句 3.12-表达式 3.13-数据类型 3.14-常量/变量 3.15-标识符
线程的同步与互斥
基于FPGA的任意字节数的串口接收(含源码工程)
Project (7) - PolarSeg point cloud semantic segmentation
[C language] In-depth understanding of pointers and arrays (issue 4)
openEuler 知:abi 检测
c语言结构体、函数以及指针练习(简单通讯录)
基于 LSTM 的分布式能源发电预测(Matlab代码实现)
dlopen failed: library "libtaml.so" not found
数据库的备份与恢复「建议收藏」
Kubernetes 开发环境比对
CAS:851113-28-5 (Biotin-ahx-ahx-tyramine)
-象棋比赛-
《MySQL入门很轻松》第4章:数据表中存放的数据类型
2022金九银十工作潮,怎么样才能成功跳槽面试拿到高薪呢?
JSP简介
Description of AirFlow
【毕业设计】 基于Stm32的家庭智能监控系统 - 单片机 图像识别 人体检测 AI