#include <iostream>
#include <string>
#include <cctype>
using namespace std;
signed main() {
string line, buff = "";
bool isPalindrome = true;
getline(cin, line);
for (int i = 0; i < line.size(); i++) {
if (isalnum(line[i]))
buff += line[i];
}
for (int i = 0; i < buff.size() / 2; ++i)
{
if (buff[i] != buff[buff.size() - i - 1])
isPalindrome = false;
break;
if (isPalindrome)
cout << "TRUE";
else
cout << "FALSE";
return 0;
1) -165
2) 3
3) -214277011200
4) 0
5) 3 6 9 12 15 18 21 24 27 30
код:
n = []
for i in range(-30, 31, 3):
if i != 0:
n.append(i)
x1, x2, x3, x4, x5 = 0, 0, 1, 0, []
mine = 0
maxe = 0
pos = 0
for i in n:
pos += 1
if i < 0:
x1 += i
if i % 5 == 0 and i < 20:
x2 += 1
if pos % 2 == 0:
x3 *= i
if pos == 1:
mine = i
elif pos == 20:
maxe = i
if i % 3 == 0 and i > 0:
x5.append(str(i))
x4 = mine + maxe
print(' '.join(x5))
#include <iostream>
#include <string>
#include <cctype>
using namespace std;
signed main() {
string line, buff = "";
bool isPalindrome = true;
getline(cin, line);
for (int i = 0; i < line.size(); i++) {
if (isalnum(line[i]))
buff += line[i];
}
for (int i = 0; i < buff.size() / 2; ++i)
{
if (buff[i] != buff[buff.size() - i - 1])
{
isPalindrome = false;
break;
}
}
if (isPalindrome)
cout << "TRUE";
else
cout << "FALSE";
return 0;
}
1) -165
2) 3
3) -214277011200
4) 0
5) 3 6 9 12 15 18 21 24 27 30
код:
n = []
for i in range(-30, 31, 3):
if i != 0:
n.append(i)
x1, x2, x3, x4, x5 = 0, 0, 1, 0, []
mine = 0
maxe = 0
pos = 0
for i in n:
pos += 1
if i < 0:
x1 += i
if i % 5 == 0 and i < 20:
x2 += 1
if pos % 2 == 0:
x3 *= i
if pos == 1:
mine = i
elif pos == 20:
maxe = i
if i % 3 == 0 and i > 0:
x5.append(str(i))
x4 = mine + maxe
print(' '.join(x5))