// delete.cpp: определяет точку входа для консольного приложения.
//
#include "stdafx.h"
#include <iostream>
#include <conio.h>
using namespace std;
int main()
{
setlocale(LC_ALL, "rus");
int num, result;
cout << "Введите четырехзначное число: ";
cin >> num; //1234
//Проверка на ввод
int p = 1;
while (p <= num)
p *= 10;
p /= 10;
if (p != 1000)
{
cout << "Вы ввели не четырехзначное число";
_getch();
return -1;
}
int thousand = num / 1000 * 1000; //1 -> 1000
int unit = num % 10; // 4
result = num % 1000 / 10; //23
result = result / 10 + result % 10 * 10; // 32
result = thousand + result * 10 + unit; //1000 + 320 + 4
cout << result; //1324
_getch();
}
var a,b,c,c1,d,max:integer;
begin
readln(a);
b:=a div 100 ;
c:= a mod 10;
c1:= a mod 100;
d:= c1 div 10;
if(b > c) then max:= b
else max:= c;
if (max < d) then max := d; writeln(max);
readln;
end.
2)program vtoroe;
var a,b,c,c1,d,pro:integer;
begin
readln(a);
b:=a div 100 ;
c:= a mod 10;
c1:= a mod 100;
d:= c1 div 10;
pro:= b * c * d ;
if (pro > 99) and (pro < 1000) then writeln('Yes');
readln;
end.
3)program trete;
var a,b,c,d,e,f,g,j,sum1,sum2:integer;
begin
readln(a);
b:=a div 1000 ;{1}
c:=a mod 10; {4}
e:=a mod 1000; {234}
f:=e div 100; {2}
g:=e mod 100;{34}
j:=g div 10; {3}
sum1:= b + f ;
sum2:= j + c;
if (sum1 = sum2) then writeln('Yes')
else writeln('NO');
readln;
end.