Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
153481 李鸣 排列组合 C++ Accepted 1 MS 264 KB 514 2026-05-17 16:25:27

Tests(1/1):


Code:

#include <iostream> using namespace std; int main() { int a[] = {2,4,6,8}; int cnt = 0; // 三重循环枚举三位不同下标 for(int i=0;i<4;i++) { for(int j=0;j<4;j++) { for(int k=0;k<4;k++) { if(i!=j && j!=k && i!=k) { cout << a[i] << a[j] << a[k] << endl; cnt++; } } } } cout << cnt << endl; return 0; }