TJU : 1527 (Euchre Results)



// http://acm.tju.edu.cn/toj/showp1527.html
// Tag: Adhoc

#include <cstdio>
#include <cstring>
#include <cstdlib>
using namespace std;

int main ()
{
    int a [6];

    while ( true ) {
        int sum = 0;

        for ( int i = 0; i < 6; i++ ) {
            scanf ("%d", &a [i]);
            sum += a [i];
        }

        if (sum == 0) break;

        int totalGame = a [0] + a [1] + a [2] + a [3];
        int annaWin = totalGame - (a [0] + a [2] + a [4]);
        int annaLoose = totalGame - (a [1] + a [3] + a [5]);

        printf ("Anna's won-loss record is %d-%d.\n", annaWin, annaLoose);
    }

    return 0;
}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s