登录
首页 » c » 中间数

中间数

于 2022-09-17 发布 文件大小:43.51 kB
0 101
下载积分: 2 下载次数: 1

代码说明:

问题描述 在一个整数序列A1, A2, …, An中,如果存在某个数,大于它的整数数量等于小于它的整数数量,则称其为中间数。 在一个序列中,可能存在多个下标不相同的中间数,这些中间数的值是相同的。 给定一个整数序列,请找出这个整数序列的中间数的值。 输入说明 输入的第一行包含了一个整数n,表示整数序列中数的个数,1 ≤ n ≤ 1000。 第二行包含n个正整数,依次表示A1, A2, …,An,1 ≤ Ai ≤ 1000。 输出说明 如果序列的中间数存在,则输出中间数的值,否则输出-1表示不存在中间数。 输入样例 输入样例1 6 2 6 5 6 3 5 输入样例2 4 3 4 6 7 输出样例 输出样例1 5 输出样例2 -1

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • HJTAG
    Open JtagС
    2006-03-26 15:53:18下载
    积分:1
  • huocheshoupiao
    火车售票系统,用链表实现录入、删除、修改等操作,使用两个链表对火车信息进行分别存储。(Train ticketing system, using the list to achieve entry, delete, modify, use two lists are stored on the train information.)
    2013-12-17 15:03:14下载
    积分:1
  • AIS
    將經緯度資料轉換為AIS之AIVDM的NMEA語句,並輸出至串列埠。(Arduino program for translate Latitude and Longitude data into AIVDM NMEA phrase.)
    2014-02-12 20:19:47下载
    积分:1
  • 对STM8L151各个功能模块测试程序
    对STM8L151各个功能模块测试程序,十分方便初学STM8L151各个功能有IO中断,中断唤醒,定时中断,串口接收发送,AD转换程序,SLEEP模式(STM8L151 each function module test program, very convenient beginners STM8L151 each function is IO interruption, interrupt, timer interrupt, serial port receive send, AD converter, the SLEEP mode)
    2015-02-24 13:27:19下载
    积分:1
  • stm32f103c8t6+mpu6050+oled
    说明:  可以实现陀螺仪角度检测以及角度时间在oled上的完美显示(The gyroscope angle detection and the perfect display of angle time on OLED can be realized.)
    2021-01-03 16:28:58下载
    积分:1
  • OFDM-based_cellular_mobile_communication_system_Ke
    DPD设计的硕士论文,相当的不错!值得收藏!(DPD design master thesis, is pretty good! Worth collecting!)
    2010-09-03 23:27:21下载
    积分:1
  • matlab
    matlab遗传算法,matlab遗传算法程序,45666011matlab遗传算法程序(matlab genetic algorithm, matlab genetic algorithm program, 45666011matlab genetic algorithm program)
    2009-11-24 11:29:28下载
    积分:1
  • cholesky
    矩阵的cholesky分解,对学习系统辨识的建模应用具有很大的帮助。(Cholesky decomposition of matrix)
    2011-09-02 09:14:20下载
    积分:1
  • keyboard-master
    说明:  this car race game cpp file . Thank you !!!
    2020-06-20 13:20:01下载
    积分:1
  • 用于验证正则表达式是否正确。 例如在表达式文本框里输入:(^...
    用于验证正则表达式是否正确。 例如在表达式文本框里输入:(^-?dd*.d*$)|(^-?dd*$)|(^-?.dd*$) 在下面的测试文本框里输入数字,小数,负数,显示结果“通过”,若输入字母,显示“不通过”。 希望本工具对你编辑正则表达式时有作帮助。 用.NET做的第一个程序。 感谢群里朋友对初学才的支持。 需.NET2.0支持,在winxp上测试通过。-used to validate regular expression is correct. For example, in the expression Message text input : (^- d d* . d*$)|(^- d d*$)|(^- . d d* $) Below the test Message text input figures, the minority negative, the result will be displayed "adopt", if the importation of letters, Display "is not passed." Hope this tool to your editor is a regular expression for help when. Used.NET to do the procedure. Lane thanked the group of friends only with the support of a novice. Required.NET2.0 support of the winxp on the test.
    2022-03-07 04:23:41下载
    积分:1
  • 696518资源总数
  • 106208会员总数
  • 21今日下载