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初准备:安装easy_install和pip
安装easy_install wget http://peak.telecommunity.com/dist/ez_setup.py python ez_setup.py 安装pip wget htt ...
- UI设计的奥义
个人觉得一个好的UI应该具备如下特点 1.符合人类认知行为 2.契合人体生物学 3.平滑,流畅 4.适当的交互会让你的应用更加成功 5.动态的内容才是招蜂引蝶的资本
- Python SqlAlchemy使用方法
1.初始化连接 from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker engine = create ...
- Linux下为PHP安装oci8及pdo_oci扩展
下载instantclient 以及sdk instantclient-basic-linux-x86-64-11.2.0.2.0.zip oracle-instantclient11.2-sdk-1 ...
- about backbone
http://presentation.tiddr.de/backbone-presentation/introduction/index.html#Further%20issues http://m ...
- Ubuntu下Qt编译报错“cannot find -lGL”的解决方案
转自cannot find -lGL Solved the problem by installing the "libglu1-mesa-dev" package. sudo a ...
- UVALive - 3401 Colored Cubes
好久没写解题回顾了.主要是没什么时间,但是还是一直在刷题,图论刷了70%的知识点,不过感觉长进不是很大,所以觉得还是得一步步来,最近还是先从刘汝佳大白书把前面基础章节刷完然后再决定以后的训练方式吧. ...
- iOS开发UI篇—Quartz2D简单使用(一)
iOS开发UI篇—Quartz2D简单使用(一) 一.画直线 代码: 1 // 2 // YYlineview.m 3 // 03-画直线 4 // 5 // Created by apple on ...
- java中的CAS
转自:http://www.blogjava.net/mstar/archive/2013/04/24/398351.html Atomic 从JDK5开始, java.util.concurrent ...
- 【HDOJ】4516 威威猫系列故事——因式分解
可解的算法太多了,采用的算法是试x的值.注意题目的输入x^3-2x^2不会写成x^3+-2x^2.一直RE在这儿. /* 4516 */ #include <iostream> #incl ...