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:直接算怎么会wa呀.

Posted by wuji0447 at 2006-08-29 08:24:54 on Problem 2926
In Reply To:直接算怎么会wa呀. Posted by:wuji0447 at 2006-08-26 16:33:00
> #include "iostream"
> #include "math.h"
> #include "math.h"
#include "stdio.h"
/*#include "iostream.h"*/
void main()
{   int s,i,j,k;
    
    double sum1,max=0;
    double a[10000][5];
    scanf("%d",&s);
	for(i=0;i<s;i++)
		for(j=0;j<5;j++)
		scanf("%lf",&a[i][j]);
			//cin>>a[i][j];
/*		printf("%d\n",s);*/
 /*    for(i=0;i<s;i++)
	 { for(j=0;j<5;j++)
			 printf("%.2f ",a[i][j]);
	   printf("\n");
	 }
	 */
    for(i=0;i<s-1;i++)
		for(k=i+1;k<s;k++)
		{for(j=0,sum1=0;j<5;j++)
	    	sum1+=fabs(a[k][j]-a[i][j]);
		
		 if(sum1>max) max=sum1;
		   
		}

  printf("%.2lf\n",max);


}

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