int main() { int A, B; setlocale(LC_ALL, "RUSSIAN"); std::cout << "Введите A >> "; std::cin >> A; std::cout << "Введите B >> "; std::cin >> B; if (A > B) B += A; else A += B; std::cout << "A=" << A << std::endl; std::cout << "B=" << B << std::endl; system("pause"); }
Answers & Comments
Verified answer
Program n1;var a,b: integer;
begin
readln(a,b);
if a>b then
begin
b:=a+b;
writeln(b);
end else if a<b then
begin
a:=a+b;
writeln(a);
end;
end.
int main()
{
int A, B;
setlocale(LC_ALL, "RUSSIAN");
std::cout << "Введите A >> ";
std::cin >> A;
std::cout << "Введите B >> ";
std::cin >> B;
if (A > B)
B += A;
else
A += B;
std::cout << "A=" << A << std::endl;
std::cout << "B=" << B << std::endl;
system("pause");
}