ACM (UVa) : 408


#include <stdio.h>
#include <algorithm>
using namespace std;

long gcd (long a, long b)
{
    while (b > 0) {
        a %= b;
        swap (a, b);
    }

    return a;
}

int main ()
{
    long a, b;

    while (scanf ("%ld %ld", &a, &b) != EOF) {

        if (gcd (a, b) == 1)
        printf("%10ld%10ld    %s\n\n", a, b, "Good Choice");

        else
        printf("%10ld%10ld    %s\n\n", a, b, "Bad Choice");
    }

    return 0;
}
Advertisements

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