Var
n, sum :integer;
begin
readln(n);
sum:= (n div 10) + (n mod 10);
write(sum,' - ');
if sum mod 2 = 0 then
write('четная')
else
write('нечетная');
end.
Просто рассмотри все возможные варианты, под условие подойдет только один. acdeb
Ответ:
// ConsoleApplication1.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include <vector>
using std::cout;
int main()
{
std::vector<int> ints = { 1 , -2, -3, -4, 5, 6, -7, -8, -9, 10 };
cout << "vector before transformation: ";
for (auto integer : ints) {
cout << integer << " ";
}
cout << std::endl;
for (std::size_t i = 1; i < ints.size(); ) {
if (ints[i] < 0) {
ints.erase(ints.begin() + i);
i += 1;
continue;
}
i += 2;
}
cout << "vector after transformation: ";
for (auto integer : ints) {
cout << integer << " ";
}
cout << std::endl;
}
Объяснение:
По условию создаем вектор, удаляем элементы из вектора, если число ниже 0, движемся через один элемент по вектору ¯\_(ツ)_/¯
<span>100(7)+x=230(5)
Переведем числа в 10 СС
100(7)=1*7^2+0*7^1+0*7^0=49
230(5)=2*5^2+3*5^1+0*5^0=50+15=65
49+x=65
x=65-49
x=16 (10)</span>