博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Java语言程序设计(基础篇)第十版 5.8 5.9
阅读量:3913 次
发布时间:2019-05-23

本文共 1255 字,大约阅读时间需要 4 分钟。

public class J5_8 {	public static void main(String[] args) {		// TODO Auto-generated method stub		java.util.Scanner input = new java.util.Scanner(System.in);		System.out.print("Enter the number of students: ");				int student = input.nextInt();		String name = "ABC";		double score = 0;		for(int i = 0;i
score) { score = scores; name = names; } } System.out.println("The higly score Student is: "+name+" score is "+score); }}
public class J5_9 {	public static void main(String[] args) {		// TODO Auto-generated method stub		java.util.Scanner input = new java.util.Scanner(System.in);		System.out.print("Enter the number of students: ");				int student = input.nextInt();		String name = "ABC";		double score = 0;		String name1 = "CBA";		double score1 = 0;		for(int i = 1;i<=student;i++)		{			System.out.print("input the "+i+"Student information: ");			double scores = input.nextDouble();			String names = input.nextLine();						if(scores >score) {				score = scores;				name  = names;			}			else if(scores > score1)			{				score1 = scores;				name1 = names;			}					}		System.out.println("The higly score Student is: "+name1+"  score is "+score1);		System.out.println("The highest score Student is: "+name+"  score is "+score);	}}

转载地址:http://fubrn.baihongyu.com/

你可能感兴趣的文章
一个情怀引发的生产事故(续)
查看>>
做架构也得讲武德
查看>>
PHP大势已去,PHP宝藏可为我所用
查看>>
asp.net core 集成 prometheus
查看>>
如何在 .NET 中使用 Redis缓存
查看>>
C#阻塞队列BlockingCollection
查看>>
在传统行业做数字化转型之业务篇
查看>>
如何在 C# 中使用 RabbitMQ
查看>>
一套标准的ASP.NET Core容器化应用日志收集分析方案
查看>>
如何使用 C# 扩展方法
查看>>
C#如何回到主线程,如何在委托指定线程执行
查看>>
服务器重新部署踩坑记
查看>>
.NET应用程序安全操作概述
查看>>
C# WPF:把文件给我拖进来!!!
查看>>
.NET5发布了,腾讯招聘点名要求精通MySQL,而不是SQLServer!
查看>>
让 CefSharp.WinForms 应用程序同时支持32位(x86)和64位(x64)的解决方案
查看>>
Docker Vs Podman
查看>>
程序员过关斩将--论系统设计的高可扩展性
查看>>
如何在 Asp.Net Core MVC 中处理 null 值
查看>>
浅谈AsyncLocal,我们应该知道的那些事儿
查看>>