在一个2行3列的表格中,不重复地填入数字1、2、3、4、5和6。
//无情的打表人
AC代码:
#include<stdio.h>
#include<iostream>
using namespace std;
int main() {
int n;
while (cin >> n)
{
if (n == 1)
{
cout << "1 2 3" << endl;
cout << "4 5 6" << endl;
}
else if (n == 2)
{
cout << "1 2 4" << endl;
cout << "3 5 6" << endl;
}
else if (n == 3)
{
cout << "1 2 5" << endl;
cout << "3 4 6" << endl;
}
else if (n == 4)
{
cout << "1 3 4" << endl;
cout << "2 5 6" << endl;
}
else if (n == 5)
{
cout << "1 3 5" << endl;
cout << "2 4 6" << endl;
}
}
//system("pause");
return 0;
}