Bài toán rất đơn giản:
code here: đã AC:
#include<iostream>
using namespace std;
int main()
{
int N;
cin >> N;
if(N==1||(N%2)==1)
{
cout << -1 << endl;
// system("pause");
return 0;
}
for(int j = 1; j <= N;j+=2)
cout << j+1 << " " << j << " ";
cout << endl;
//system("pause");
return 0;
}
Không có nhận xét nào:
Đăng nhận xét