//这个水题目也让我调试了半天.我郁闷..水啊..
//错误出在函数里面..函数的参数最开始是a,b和外面的实参是一样的..
//这样子使得结果不对..为什么不用去管..以后记住就行了.
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<iostream>
#include<math.h>
#include<vector>
const int inf = 0x3f3f3f;
using namespace std;
int Comdiv(int x,int y)
{
int c = 1;
while(c != 0)
{
c = x % y;
x = y;
y = c;
}
return x;
}
int main()
{
int a,b,n;
while(scanf("%d%d%d",&a,&b,&n) != EOF)
{
bool vis = 1;
while(n > 0)
{
n = n - Comdiv(a,n);
if(n < 0)
{
vis = 0;
}
else
{
if(n > 0 )
{
n = n - Comdiv(b,n);
if(n == 0)vis = 0;
}
}
}
if(vis)printf("0\n");
else printf("1\n");
}
}
//错误出在函数里面..函数的参数最开始是a,b和外面的实参是一样的..
//这样子使得结果不对..为什么不用去管..以后记住就行了.
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<iostream>
#include<math.h>
#include<vector>
const int inf = 0x3f3f3f;
using namespace std;
int Comdiv(int x,int y)
{
int c = 1;
while(c != 0)
{
c = x % y;
x = y;
y = c;
}
return x;
}
int main()
{
int a,b,n;
while(scanf("%d%d%d",&a,&b,&n) != EOF)
{
bool vis = 1;
while(n > 0)
{
n = n - Comdiv(a,n);
if(n < 0)
{
vis = 0;
}
else
{
if(n > 0 )
{
n = n - Comdiv(b,n);
if(n == 0)vis = 0;
}
}
}
if(vis)printf("0\n");
else printf("1\n");
}
}