#include <iostream>
#include <string>
bool is_palindrome(const std::string& s) {
std::string r(s);
std::reverse(r.begin(), r.end());
return s == r;
}
int main() {
std::string s1,s2;
setlocale(LC_ALL, "Russian");
std::cout << "Введите число 1: ";
std::getline(std::cin, s1);
std::cout << "Введите число 2: ";
std::getline(std::cin, s2);
if (is_palindrome(s1)|| is_palindrome(s2))
std::cout << "Одно из введенных чисел является палиндромом " << std::endl;
else
std::cout << "Ни одно из введенных чисел не является палиндромом " << std::endl;
return 0;
}
#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;
}
}
}
}