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:直接算怎么会wa呀.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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator