HW4.8
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter the number of students: "); int numberOfStudents = input.nextInt(); int score = 0; int max = 0; String student = ""; String maxStudent = ""; for(int i = 0; i < numberOfStudents; i++) { System.out.print("Enter a student's name: "); student = input.next(); System.out.print("Enter his score: "); score = input.nextInt(); if(score > max) { max = score; maxStudent = student; } } input.close(); System.out.println("The one has best score is " + maxStudent + ", his score is " + max); } }
HW4.8的更多相关文章
- HW4.46
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...
- HW4.45
public class Solution { public static void main(String[] args) { int count = 0; for(int i = 1; i < ...
- HW4.44
public class Solution { public static void main(String[] args) { double randX; double randY; int hit ...
- HW4.43
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...
- HW4.42
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...
- HW4.41
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...
- HW4.40
public class Solution { public static void main(String[] args) { long positiveSide = 0; long negativ ...
- HW4.39
public class Solution { public static void main(String[] args) { double sum; double baseSalary = 500 ...
- HW4.38
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...
- HW4.37
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...
随机推荐
- python在linux制作图形界面(snack)
snack是一个用于在linux制作图形界面(GUI)的模块,该模块由c编写,而且redhat的系统都自带这个模块. 1.获取模块 虽然redhat系统会自带这个模块,但是直接去import snac ...
- C#中的socket编程方法
服务器: 第一步,准备socket套接字:Socket sockfd = new Socket(AddressFamily.InterNetwork,SocketType.Stream,Protoco ...
- 一步步学习NHibernate(8)——HQL查询(2)
请注明转载地址:http://www.cnblogs.com/arhat 在上一章中,老魏带着大家学习了HQL语句,发现HQL语句还是非常不错的,尤其是在懒加载的时候,书写起来比较的舒服,但是这里老魏 ...
- linux下定时发送邮件
at命令可以在某个时间运行某个程序,而mail可以以命令行的方式把存于一个文本中的邮件正文发送抄送出去. 具体用法: 1. 把email正文准备好,比如写在email.txt里 2. 然后写一个脚 ...
- Nhibernate 分页功能
cs: public IEnumerable<ArticleView> MyGetAll(int start, int limit, ref int count) { try { var ...
- Python属性、方法和类管理系列之----元类
元类的介绍 请看位于下面网址的一篇文章,写的相当好. http://blog.jobbole.com/21351/ 实例补充 class Meta(type): def __new__(meta, c ...
- [转载]C#.NET中Dns类的常用方法及说明
IP是一种普遍应用于因特网.允许不同主机能够相互找到对方的寻址协议.IP地址由4个十进制的数字号码所组成,而每一个号码的值介于0~255之间,它虽然解决了网络上计算机的识别问题,但是IP地址确不容易记 ...
- su: /bin/bash: Permission denied
https://bbs.archlinux.org/viewtopic.php?id=105541 New user created as: groupadd mygroupuseradd -s /b ...
- 面向XX编程
[一篮饭特稀原创,转载请注明出自http://www.cnblogs.com/wanghafan/p/5033186.html ] 基于面向XX编程的个人理解 面向过程编程 Procedure Or ...
- SQLite入门与分析(八)---存储模型(3)
写在前面:接上一节,本节主要讨论索引页面格式,以及索引与查询优化的关系. (1)索引页面格式sqlite> select * from sqlite_master;table|episodes| ...