计蒜客-泥塑客
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; } }
相关文章推荐
- 7.20总结
- bzoj 3884 上帝与集合的正确用法 指数循环节
- 关于浮动清除的一些小感悟,4种方法清除浮动
- unity 类的序列化
- 【HD 1222】Wolf and Rabbit
- Matlab Kalman滤波
- Nginx负载均衡配置实例详解
- AngularJS 笔记——$on、$emit和$broadcast的使用与区别
- 【POJ 1364】King(差分约束系统)
- HDOJ 4548 美素数
- PostgreSQL 物流调度算法探索 - 基于PostGIS/pgrouting/机器学习
- HDOJ 1201 18岁生日
- poj Aggressive cows
- [ARM]ldr和 adr/adrl 伪指令的区别
- C语言之复杂指针详解
- abelkhan服务器框架
- 杭电 Problem 2008 分拆素数和 【打表】
- 从零开始搭建web项目并部署到本地服务器
- C学习笔记(十二)函数详解
- 读者写者问题浅析(代码实现)