Skip to content

Instantly share code, notes, and snippets.

@KT-Yeh
Created February 8, 2014 03:24
Show Gist options
  • Save KT-Yeh/8876226 to your computer and use it in GitHub Desktop.
Save KT-Yeh/8876226 to your computer and use it in GitHub Desktop.
#include <cstdio>
using namespace std;
int gcd(int a, int b)
{
while (b){
int temp = a % b;
a = b;
b = temp;
}
return a;
}
int main()
{
int step, mod;
while (scanf("%d%d",&step,&mod) != EOF){
printf("%10d%10d %s\n\n",step,mod,
gcd(step,mod) == 1 ? "Good Choice":"Bad Choice");
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment