Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:哈哈哈,终于做出来了!!!!!!

Posted by 00430030 at 2005-01-11 15:05:06 on Problem 1547
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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator