您的位置:首页 > 其它

计蒜客-泥塑客

2016-07-20 20:44 169 查看
//转载自逆天耗子

import java.util.Scanner;
public class Main{

public static void main(String[] args){

Scanner scan = new Scanner(System.in);
//while(true) 一直为真,无限循环,知道break 跳出
while(true){
int n = scan.nextInt();
scan.nextLine();
if(n==-1) {
break;
}
Stu[] stu = new Stu
;
int max = Integer.MIN_VALUE;
int min = Integer.MAX_VALUE;
int k1=0,k2=0;
for(int i=0;i<n;i++){
stu[i] = new Stu(scan.nextInt(),scan.nextInt

(),scan.nextInt(),scan.next());
if(stu[i].area>max){
max=stu[i].area;
k1=i;
}
if(stu[i].area<min){
min=stu[i].area;
k2=i;
}
}
System.out.println(stu[k1].name+" took clay from "+stu[k2].name+".");
}
}
}
class Stu{
int length;
int width;
int height;
int area;
String name;
Stu(int l,int w,int h,String name){
this.length=l;
this.height=h;
this.width=w;
this.name=name;
this.area=l*h*w;
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: