#include <windows.h>
#include <string>
#include <iostream>
#include <iomanip>
using namespace std;
void PrintArr(int *a);
const int sz= 10;
int main(int argc, char **argv)
{
system("chcp 1251 > nul"); // Руссификация сообщений
setlocale(LC_ALL, "Russian");
int arr[sz]= {1,2,3,4,5,6,7,8,9,10};
int tmp;
PrintArr(arr);
for (int i=0; i<10; i+=2)
{
tmp= arr[i]; arr[i]= arr[i+1]; arr[i+1]= tmp;
}
PrintArr(arr);
system("pause");
return 0;
}
void PrintArr(int *a)
{
for (int i= 0; i<sz; i++) cout << a[i] << '\t';
cout << endl;
}
в таблице будет №3