#pragma warning(disable:4786)
#include<iostream>
#include<algorithm>
#include<cmath>
#include<stdio.h>
#include<time.h>
#include<stdlib.h>
#include<queue>
#include<set>
#include<vector>
#include<string>
#include<ctime>
#include<string.h>
using namespace std;
#define pi acos(-1.0)
//#define LL __int64
typedef long long LL;
#define INF 0x7fffffffffffffff
#define bug puts("hear!")
#define inf 0x7fffffff
#define eps 1e-10
#define FRE freopen("in.txt","r",stdin)
#define E exp(1.0)
#define mod 1000000007
#include<iostream>
int gcd(int a,int b)
{
if(!b) return a;
return gcd(b,a%b);
}
int main()
{
int s,m;
while(scanf("%d%d",&s,&m)!=EOF)
{
if(gcd(s,m)==1) printf("%10d%10d Good Choice\n\n",s,m);
else printf("%10d%10d Bad Choice\n\n",s,m);
}
return 0;
}
求NM的gcd函数,然后看看是不是互质就OK
HDU1014--Uniform Generator HDU(112)
最新推荐文章于 2017-09-18 10:33:59 发布