acm C语言 求不定方程的所有解

如题所述

int main()
{
    int a, b, c, x, t, no;
    scanf("%d",&t);
    while(t--)
    {
        scanf("%d%d%d",&a,&b,&c);
        no=1;
        for(c-=a,x=1;c>=b;c-=a,x++)
            if(c%b==0)
                no=0,printf("%d %d\n",x,c/b);
        if(no)
            puts("No");
    }
    return 0;
}

温馨提示:答案为网友推荐,仅供参考
第1个回答  2014-03-08
扩展欧几里得么
相似回答