第21660题 单选题
以下C++递归实现全排列的程序,填入正确代码后运行输出的排列总数是多少?
#include <iostream>
using namespace std;
int sum = 0;
void swap(int & a, int & b) {
    int temp = a;
    a = b;
    b = temp;
}
void pailie(int begin, int end, int a[]) {
    if (begin == end) {
        for (int i = 0; i < end; i++)
            cout << a[i];
        cout << endl;
    }
    for (int i = begin; i < end; i++) {
        __________ // 在此处填入选项
    }
}

int main() {
    int a[5] = {1, 2, 3, 4, 5};
    pailie(0, 5, a);
    return 0;
}
A

120

B

60

C

240

D

180

程序运行统计
暂无判题统计