#VC43. 趣味编程43选择题
趣味编程43选择题
- 请问21和14的最大公约数用二进制表示为。 {{ select(1) }}
-
2.输入数据为28 7,以下程序的结果为( )。
#include <iostream>
using namespace std;
int main()
{
int x,y,t,ans;
cin >> x >> y;
if(x < y)
{
t=x;
x=y;
y=t;
}
while(x!=y)
{
x-=y;
if(x<y)
{
t=x;
x=y;
y=t;
}
}
ans=x;
cout << ans;
return 0;
}
{{ select(2) }}
- 4
- 7
- 14
- 28
- A班有36个学生,B班有30个学生。按班分组,两个班各组的人数一样多,问每组有多少个学生。以下程序中横线处的代码正确的是( )。
#include <iostream>
using namespace std;
int main()
{
int x,y,n,t;
_____1_____;
if(x < y)
{
t=x;
x=y;
y=t;
}
n=x;
while(_____2______)
n--;
cout << "每组的人数最多为:" << n << endl;
return 0;
}
{{ select(3) }}
- 横线1:cin >> x >> y 横线2:(x%y!=0) || (y%x!=0)
- 横线1:cin >> x >> y 横线2:(x%n!=0) || (y%n!=0)
- 横线1:cin >> n 横线2:(x%y!=0) || (y%x!=0)
- 横线1:cin >> n 横线2:(x%n!=0) || (y%n!=0)