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

谁能告诉我这个程序哪里出了错?????????

Posted by 19880211 at 2005-01-11 15:52:46 on Problem 1547
#include<stdio.h>
#include<math.h>
void main ()
{
   int n,i,p,q,x,y,max,min,w[10];
   scanf("%d",&n);
   while(n!=-1)
{
   struct student{
    int num1;
    int num2;
    int num3;
    char name[10];
   } stu[10];
  for(i=0;i<n;i++){ 
   scanf("%d %d %d %s",&stu[i].num1,&stu[i].num2,&stu[i].num3,&stu[i].name);
   w[i]=stu[i].num1*stu[i].num2*stu[i].num3;
  }
   max=0; 
   min=501;
   for(p=0;p<n;p++) 
	   if(max<w[p]) {x=p;max=w[p];}
   for(q=0;q<n;q++) 
	   if(min<w[q]) {y=q;min=w[q];}
   printf("%s took clay from %s.\n",stu[x].name,stu[y].name);
  scanf("%d",&n);
   }

}



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