全国计算机等级考试C语言考试程序填空题(12)

发布时间:2021-09-13 08:34:29

在考生文件夹下,给定程序FILL.C的功能是:

从键盘上输入两个正整数x,y,求它们的最大公约数。

例如:如果从键盘上输入24,36,

程序的输出应为:max is : 12。

 

 #include

  #include

  #include

  void main()

  { int x,y,t,i;

    printf("Please enter two numbers:");

    scanf("%d,%d",&x,&y);

    if(x < y)

/************found************/

    {t = x; ____(1)____ ; y = t;}

x=y;

    t = x % y;

    while( t )

    { x = y;

       y=t;

       t = x % y;

    }

  /************found************/

   printf("max is : %dn",____(2)____);

printf("maxis:%dn",y);

}

阅读更多其他试题,请访问生活日记网 用日志记录点滴生活!考试试题频道。
喜欢考试试题,那就经常来哦

该内容由生活日记网提供.