这道题,貌似和编程关系不大,我列了两方程,求解就ok了!
lost+a2+b2+c2=won+a1+b1+b2;
lost+won=(lost+a2+b2+c2)/2;
#include<stdio.h>
int main()
{
int a1,a2,b1,b2,c1,c2,won,lost,t1,t2;
scanf("%d%d%d%d%d%d",&a1,&a2,&b1,&b2,&c1,&c2);
while(!(a1==0&&a2==0&&b1==0&&b2==0&&c1==0&&c2==0))
{
t1=a1+b1+c1;
t2=a2+b2+c2;
won=(2*t2-t1)/3;
lost=won+t1-t2;
printf("Anna's won-loss record is %d-%d.\n",won,lost);
scanf("%d%d%d%d%d%d",&a1,&a2,&b1,&b2,&c1,&c2);
}
return 0;
}