第一题(NOIP2008)
#include<iostream>
using namespace std;
void foo(int a, int b, int c) {
if (a > b)
foo(c, a, b);
else
cout << a << "," << b << "," << c << endl;
}
int main() {
int a, b, c;
cin >> a >> b >> c;
foo(a, b, c);
return 0;
}
- 【判断题】该程序只输出一行。
{{ select(1) }}
- 【判断题】如果输入的三个数都相同,程序会运行错误。
{{ select(2) }}
- 【判断题】如果输入3 1 2,输出2,3,1。
{{ select(3) }}
- 【判断题】如果输入3 2 1,程序会超时。
{{ select(4) }}
- 【选择题】输入9 10 8,输出为( )。
{{ select(5) }}
- 9,10,8
- 9,8,10
- 10,8,9
- 8,9,10
- 【选择题】令n代表输入变量a、b、c的次数,则n=3时该程序的时间复杂度为( )。
{{ select(6) }}
- O(n)
- O(logn)
- O(√logn)
- O(log(n√n))