计蒜客-泥塑客

//转载自逆天耗子

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[n];
             int max = Integer.MIN_VALUE;  
             int min = Integer.MAX_VALUE;  
             int k1=0,k2=0;
             for(int i=0;inew Stu(scan.nextInt(),scan.nextInt

(),scan.nextInt(),scan.next());
                 if(stu[i].area>max){
                     max=stu[i].area;
                     k1=i;
                 }
                 if(stu[i].areaout.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;
    }
}

你可能感兴趣的:(计蒜客测试)