| 
 | ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
| Re:哈哈哈,终于做出来了!!!!!!In Reply To:Re:哈哈哈,终于做出来了!!!!!! Posted by:90405137 at 2004-12-29 16:38:17 #include<stdio.h>
#include<math.h>
void main ()
{
int n,i,j,p,q,x,y,max,min;
for(;;)
{
scanf("%d",&n);
if(n==-1) goto end;
struct student{
int a;
int b;
int c;
int d;
char name[10];
} s[10];
for(j=0;j<n;j++)
scanf("%d%d%d%s",&s[j].a,&s[j].b,&s[j].c,s[j].name);
for(i=0;i<n;i++)
s[i].d=s[i].a*s[i].b*s[i].c;
min=501;
max=0;
for(p=0;p<n;p++)
if(max<s[p].d)
{max=s[p].d;x=p;}
for(q=0;q<n;q++)
if(min<s[q].d)
{min=s[q].d;y=q;}
printf("%s took clay from %s.\n",s[x].name,s[y].name);
}
end:;
}
Followed by: Post your reply here: | 
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator