ZOJ 1796 Euchre Results

来源:互联网 发布:物理仿真模拟软件 编辑:程序博客网 时间:2024/04/28 19:34

求二次方程.

#include <iostream>#include <cstdio>using namespace std;int main(){    int a, b, c, d, e, f;    while(scanf("%d%d%d%d%d%d", &a, &b, &c, &d, &e, &f)){        if(!a && !b && !c && !d && !e && !f)break;        int c1 = (a + c + e) - (b + d + f), c2 = a + b;        int y = (c1 - c2) / -2, x = c2 - y;        printf("Anna's won-loss record is %d-%d.\n", y, x);     }       return 0;}