#include <stdio.h>#include <stdlib.h>struct student{ int len; int wid; int hig; int v; char name[11];}stu[11];int main(void){ int num,minv,maxv,min,max,i; while( scanf("%d",&num) && num!=-1) { minv = 250; maxv = 0; for(i=0; i<num; i++) { scanf("%d%d%d%s",&stu[i].len,&stu[i].wid,&stu[i].hig,stu[i].name); stu[i].v = stu[i].len*stu[i].wid*stu[i].hig; if( stu[i].v > maxv) { maxv = stu[i].v; max = i; } if(stu[i].v < minv) { minv = stu[i].v; min = i; } } printf("%s took clay from %s.n",stu[max].name,stu[min].name); }return 0;}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)