古代数学家黄宗宪一题.c

来自「C语言小程序。有白鸡问题」· C语言 代码 · 共 39 行

C
39
字号
int d,e,f;
main()
{ int x,n;
  x=725;d=715;
  s1: n=(int)(x/247);
  if(140==x-n*247)
    goto s2;
  x=x+d;
    goto s1;
  s2: n=(int)(x/391);
  if(245==x-n*391)
    goto s3;
  e=d;
  f=247;
  sub();
  x=x+d;
    goto s2;
  s3: n=(int)(x/187);
  if(109==x-n*187)
    goto s4;
  e=d;
  f=391;
  sub();
  x=x+d;
    goto s3;
  s4: printf("x=%d\n",x);
}
int sub()
{ int i,d1;
  d=e;
  i=1;
  s5: d1=d*i;
  if(fabs((d1/f)-(int)(d1/f))==0)
    goto s6;
  i=i+1;
  goto s5;
  s6: d=d1;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?