在考生文件夾下,給定程序FILL.C的功能是:
從鍵盤(pán)上輸入兩個(gè)正整數(shù)x,y,求它們的最大公約數(shù)。
例如:如果從鍵盤(pán)上輸入24,36,
程序的輸出應(yīng)為: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; |
while( t )
{ x = y;
y=t;
t = x % y;
}
/************found************/
printf("max is : %d\n",____(2)____);
printf("maxis:%d\n",y); |
![]() | ![]() .. 定價(jià):¥225 優(yōu)惠價(jià):¥213 更多書(shū)籍 |
![]() | ![]() .. 定價(jià):¥133 優(yōu)惠價(jià):¥133.0 更多書(shū)籍 |