#include <stdio.h>
struct clay{
int l;
int W;
int h;
int V;
Char Name[8];
}KID[10];
void find (int i)
{
int n;
int aver;
int thief;
int victim;
for (N=0;n<i;++n)
{
scanf ("%d%d%d%s", &KID[N].L,&KID[N].W, &kid[n].h, kid[n].name);
KID[N].V = KID[N].L * KID[N].W * KID[N].H;
Aver + = KID[N].V;
}
Aver/= N;
for (n=0; n!=i; ++n)
{
if (kid[n].v > Aver)
Thief = N;
if (KID[N].V < aver)
Victim = n;
}
printf ("%s took clay from%s.\n", Kid[thief].name, Kid[victim].name);
Return
}
int main ()
{
int i;
scanf ("%d", &i);
while (i! =-1)
{
Find (i);
scanf ("%d", &i);
}
return 0;
}
Format comparison Torture ...
The title is like this.
Millet is a kindergarten teacher, every semester of clay class, she will give each student not more than 250 cubic centimeters of the same amount of dough, teach you to do clay sculpture. In the course of the class, she found that each class happens to have a little friend to rob another kid's clay, so she decided, in the formal beginning to do before the sculpture, let everyone put the hands of the dough into a cube, and measured in the hands of the long, wide and high pinch of dough. So she could know who had been robbed of the dough.
Xiaomi teachers may take one or more classes in different semesters, so the input data may have one or more groups. The first behavior of each set of input data is an integer n, which indicates the number of children in the class, and then the N line contains three integers separated by a space and a string that represents the name of the child, and the preceding three integers are the long, wide, and high data of this academic hand's dough block. According to the provisions of the kindergarten, each class has a maximum of 9 children, at least 2 children, each child in the status of the system name is not more than 8 characters. When the number of children in a class is 1, there are no more classes.
The number of output lines is the same as the number of classes that the Xiaomi teacher takes, in the form "X took clay from Y", please refer to sample output for details.
Sample input
310 2 Jill5 3 Will5 5 Bill42 4 Cam4 3 7 SAM8 1 GRAHAM6 2 7 Pam 1
Sample output
From Cam.
"C" I was wrong in the end there ........