打印一组数字中最大数及出现的次数
来源:互联网 发布:软件小品官网 编辑:程序博客网 时间:2024/05/16 16:23
/*Enter the integer numbers: 3 5 2 5 5 5 0The largest number is: 5The occurence count of the largest number is:4*/import java.util.Scanner;public class ShowMaxNumberAndCount { public static void main(String[] args) { Scanner input = new Scanner(System.in); int number = 1, max, count = 1; System.out.print("Enter the integer numbers: "); max = input.nextInt(); while (number != 0) { number = input.nextInt(); if (max < number) max = number; else if(max == number) count++; } System.out.println("The largest number is: " + max); System.out.println("The occurence count of the largest number is:" + count); }}
0 0
- 打印一组数字中最大数及出现的次数
- HDU 1800 Flying to the Mars -- 求一组数中出现频率最大的那个数出现的次数
- C语言找一组数中单独出现的数字
- 数组中出现次数最多的数及出现次数
- 利用Map实现统计一组数字(字母)中每个数字(字母)出现的次数
- 找出一组数出现次数超过一半的数
- 一组数据中1到9中间的数出现的次数
- 求出一堆数中出现次数超过一半的数字
- 统计你的手机号码中出现次数最多的数字,并打印出此数字及其出现次数
- 统计你的手机号码中出现次数最多的数字,并打印出此数字及其出现次数
- 删除一组数中重复的数字
- golang判断切片中重复出现次数最多的数字及出现次数
- 一组数字,求其能组成的最大数?
- 一组数字,求能组成的最大数
- 一组数字中,有两个数字出现一次,剩下数字出现两次,求这两个数
- 一组数字中只有两个数单独出现,其他数成对出现,找出这两个数
- c++求一组数据中出现次数最多的数《c++程序设计原理与实践》第4章习题16
- c++实现输入一组字符串,找出字符串中最大最小和统计相同字符串出现次数
- 登录出错不过3,结合springsec
- java使用Xstream注解 解析xml文件 并将数据导入MySql数据库中
- 大数相乘之求N!
- Spring如何实现自动依赖注入-------autowire
- .net/c#得到EXCEL表格中的有效行数和列数
- 打印一组数字中最大数及出现的次数
- LayoutInflater.inflate(resid, parent, false)
- 在家你懂的貌晾够讼澈戳颐蘸蔚磁于
- ASP.NET MVC Json()处理大数据异常解决方法
- Perl Learning 8 Processing Text with Regular Expression
- python中的循环语句
- grails g:formRemote 与 ajax 对比
- 9.ServletConfig对象
- Android 游戏存档位置分析