Falling Ants

来源:互联网 发布:软件开发人员等级 编辑:程序博客网 时间:2024/05/21 22:57

Falling Ants

这里写图片描述
这里写图片描述

直接按照题目意思求

#include <iostream>using namespace std;#include <stdio.h>int main(){      int n;    cin >> n;    while(n != 0){          int l, w, h, maxs=0, maxh=0;          for(int i = 1; i <= n;i++){            cin >> l >> w >> h;            if(h > maxh){                maxh = h;                maxs = l*w;            }              if(h == maxh && l*w > maxs) maxs=l*w;          }          cout << maxs*maxh << endl;          cin >> n;    }  }
0 0