Var a, b, c, d, s, k: integer;
begin
write('Введите k: '); readln(k);
a := k div 1000; {тысячи}
b := (k mod 1000) div 100; {сотни}
c := (k mod 100) div 10; {десятки}
d := k mod 10; {единицы}
s := d * 1000 + c * 100 + b * 10 + a;
writeln('k = ', k, #10, 's = ', s);
end.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<span>uses</span> crt;
<span>var</span> a<span>,</span>b<span>,</span>c<span>,</span>d<span>,</span>s1<span>,</span>s2<span>,</span>t<span>:</span><span>integer</span>; k<span>:</span><span>boolean</span>;
<span>begin</span>
clrscr;
<span>write</span><span>(</span><span>'Введите четырех значное число: '</span><span>)</span>; <span>readln</span><span>(</span>t<span>)</span>;
a<span>:=</span>t <span>div</span><span>1000</span>;
b<span>:=</span><span>(</span>t <span>mod</span><span>1000</span><span>)</span><span>div</span><span>100</span>;
c<span>:=</span><span>(</span>t <span>mod</span><span>100</span><span>)</span><span>div</span><span>10</span>;
d<span>:=</span>t <span>mod</span><span>10</span>;
s1<span>:=</span>a<span>+</span>b;
s2<span>:=</span>c<span>+</span>d;
k<span>:=</span>s1<span>=</span>s2;
<span>writeln</span><span>(</span>k<span>)</span>;
<span>readln</span><span>end</span>.
Язык паскаля
program skorost;
var
a,b,c:real;
begin
writeln ('Введите расстояние в км');
readln (a);
writeln ('Введите скорость в часах');
readln (b);
c:=a/b;
writeln ('Скорость = ',c);
readln;
end.