| ||||||||||
| 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 | |||||||||
我在自己的TC上运行是正确的啊!!!为什么提交不对呢?赋有代码#include<stdio.h>
#include<math.h>
main()
{long i,j,k;
long a[5000],temp;
long n,b=0;
scanf("%d",&n);
while(n)
{ for(i=0;i<n;i++)
scanf("%ld",&a[i]);
for(i=0;i<n-1;i++)
for(j=n-1;j>i;j--)
if(a[i]<a[j]) {temp=a[j];
a[j]=a[i];
a[i]=temp;
}
b=0;
for(i=1;i<n-2;i++)
for(j=i+1;j<n-1;j++)
for(k=j+1;k<n;k++)
{ if(a[0]==a[i]+a[j]+a[k])
b=1; }
if(b==1) printf("%ld\n",a[0]);
else printf("no solution\n");
scanf("%d",&n);
}
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator