当前位置:网站首页>-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;
}
边栏推荐
猜你喜欢
[SUCTF 2019]CheckIn (.htaccess和.user.ini)
【C语言】通讯录《静态内存版本》
聚焦热点 | ISC 2022软件供应链安全治理与运营论坛圆满落幕
WPF DataGrid 使用数据模板
arm-4-裸板开发
技术分享 | 接口自动化测试如何处理 Header cookie
D-Biotinol Involved by Biotin, CAS No: 53906-36-8 Specific Properties Description
3.11-程序基本的控制语句 3.12-表达式 3.13-数据类型 3.14-常量/变量 3.15-标识符
CAS:183896-00-6 (Biotin-PEG3-C3-NH2) PEG derivative
LSTM-based distributed energy generation prediction (Matlab code implementation)
随机推荐
3.4 - 编译与解释 3.5 - 编译过程 3.8 - 文法
有PEG-Biotin参与的(CAS:1778736-18-7)Biotin-PEG4-OH广泛用于分子靶点检测
算法---整数替换(Kotlin)
pytest:如何在测试中编写和报告断言
数据的存储——C语言
【毕业设计】 基于Stm32的家庭智能监控系统 - 单片机 图像识别 人体检测 AI
Docker interview question 2--get the number of database connections and docker-compose
The older tester has just passed the "hurdle" of being 35 years old, and I want to tell you something from my heart
Leetcode83. 删除排序链表中的重复元素
为什么不建议你在 Docker 中跑 Mysql ?
JSP简介
今日睡眠质量记录61分
共创 Ray 中文社区,Ray Forward Meetup 2022 直播邀你参加!
构建平衡二叉树「建议收藏」
使用C语言实现静态链表
【猜凶手,猜名次,杨辉三角】经典小学奥数的代码逻辑是什么?
CAS:851113-28-5 (Biotin-ahx-ahx-tyramine)
由生物素参与的D-Biotinol,CAS号:53906-36-8具体特性说明
Leetcode79. 单词搜索
Win7怎么把控制面板添加到右键菜单