Problema 7

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

Problema 7

#include <iostream>
using namespace std;

int main()
{
int v[100], n, aux;
cin >> n;
for (int i = 0; i < n; i++)
{
cin >> v[i];
}
for (int i = 0; i < n / 2; i++)
{
aux = v[n - 1 - i];
v[n - 1 - i] = v[i];
v[i] = aux;
}
for (int i = 0; i < n; i++)
cout << v[i] << " ";
system("pause");
return 0;
}

You might also like