#include <iostream>
#include <cstdlib>
#include <ctime>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
vector<int> arr;
int size, min(9999999), sum(0);
cout << "N: ";
cin >> size;
for (int i = 0; i < size; ++i) {
int temp;
cout << "Element #" << i + 1 << ": ";
cin >> temp;
arr.push_back(temp);
if (temp >= 0 && temp < min) {
min = temp;
}
if ((i + 1) % 2 == 0) { // нумеруем элементы с 1
sum += temp;
cout << "Min: " << min << endl;
cout << "Sum: " << sum << endl;
for (int i = arr.size()-1; i>=0; --i) {
cout << arr[i] << " ";
vector< vector<int> > arr;
arr.resize(8);
for (int i = 0; i < 8; ++i) {
arr[i].resize(7);
for (int j = 0; j < 7; ++j) {
arr[i][j] = rand();
cout << arr[i][j] << " ";
if (j == 6) {
cout << endl;
swap(arr[3], arr[0]);
swap(arr[4], arr[7]);
#include <iostream>
#include <cstdlib>
#include <ctime>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
vector<int> arr;
int size, min(9999999), sum(0);
cout << "N: ";
cin >> size;
for (int i = 0; i < size; ++i) {
int temp;
cout << "Element #" << i + 1 << ": ";
cin >> temp;
arr.push_back(temp);
if (temp >= 0 && temp < min) {
min = temp;
}
if ((i + 1) % 2 == 0) { // нумеруем элементы с 1
sum += temp;
}
}
cout << "Min: " << min << endl;
cout << "Sum: " << sum << endl;
for (int i = arr.size()-1; i>=0; --i) {
cout << arr[i] << " ";
}
}
#include <iostream>
#include <cstdlib>
#include <ctime>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
vector< vector<int> > arr;
arr.resize(8);
for (int i = 0; i < 8; ++i) {
arr[i].resize(7);
}
for (int i = 0; i < 8; ++i) {
for (int j = 0; j < 7; ++j) {
arr[i][j] = rand();
cout << arr[i][j] << " ";
if (j == 6) {
cout << endl;
}
}
}
swap(arr[3], arr[0]);
swap(arr[4], arr[7]);
cout << endl;
for (int i = 0; i < 8; ++i) {
for (int j = 0; j < 7; ++j) {
cout << arr[i][j] << " ";
if (j == 6) {
cout << endl;
}
}
}
}