| ||||||||||
| 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 | |||||||||
为何WA啊???哪位大牛给点数据啊…………#include<stdio.h>
int main()
{
int a[7];
int i,j,s,k=0;
while(1)
{
for(i=1;i<=6;i++)
scanf("%d",&a[i]);
if(a[1]==0&&a[2]==0&&a[3]==0&&a[4]==0&&a[5]==0&&a[6]==0)
break;
else
{
++k;
s=0;
for(i=1;i<=6;i++)
s+=i*a[i];
if(s%2==1)
printf("Collection #%d:\nCan't be divided.\n\n",k);
else
{
int t=0;
for(i=6;i>=1;i--)
{
for(j=0;j<=a[i];j++)
if((t+j*i)<=s/2)
t+=j*i;
else break;
}
if(t==s/2)
printf("Collection #%d:\nCan be divided.\n\n",k);
else
printf("Collection #%d:\nCan't be divided.\n\n",k);
}
}
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator