#include <iostream>using std::cout;using std::endl;#include <cstdlib>using std::rand;using std::srand;#include <ctime>using std::time;int main(){ int a[12]; for(int i = 0; i < 12; i++) { a[i] = rand() % 21; cout << a[i] << ' '; } cout << endl; int temp; for(int i = 0, j = 11; i < j; i++, j--) { temp = a[i]; a[i] = a[j]; a[j] = temp; } for(int i = 0; i < 12; i++) { cout << a[i] << ' '; } cout << endl; return 0;}
#include <iostream>
using std::cout;
using std::endl;
#include <cstdlib>
using std::rand;
using std::srand;
#include <ctime>
using std::time;
int main()
{
int a[12];
for(int i = 0; i < 12; i++)
{
a[i] = rand() % 21;
cout << a[i] << ' ';
}
cout << endl;
int temp;
for(int i = 0, j = 11; i < j; i++, j--)
{
temp = a[i];
a[i] = a[j];
a[j] = temp;
}
for(int i = 0; i < 12; i++)
{
cout << a[i] << ' ';
}
cout << endl;
return 0;
}
#include <iostream>
using std::cout;
using std::endl;
#include <cstdlib>
using std::rand;
using std::srand;
#include <ctime>
using std::time;
int main()
{
int a[12];
for(int i = 0; i < 12; i++)
{
a[i] = rand() % 21;
cout << a[i] << ' ';
}
cout << endl;
int temp;
for(int i = 0, j = 11; i < j; i++, j--)
{
temp = a[i];
a[i] = a[j];
a[j] = temp;
}
for(int i = 0; i < 12; i++)
{
cout << a[i] << ' ';
}
cout << endl;
return 0;
}