<span>var a,b: integer;
function NOD(x,y: integer): integer;
begin;
if x<>0 then NOD:=NOD(y mod x,x) else NOD:=y;
end;
</span><span>begin;
readln(a,b);
writeln( 'НОД = ', NOD(a,b) );
end.</span>
Такой вопрос уже был... на этом сайте
Var
a: array[1..10] of integer;
i, j, temp: integer;
begin
randomize;
for i := 1 to 10 do
begin
a[i] := random(100,999);
write(a[i]:3);
end;
writeln;
for i := 1 to 10 - 1 do
for j := i + 1 to 10 do
if a[i] > a[j] then
begin
temp := a[i];
a[i] := a[j];
a[j] := temp;
end;
for i := 1 to 10 do
write(a[i]:3);
end.
Program Program1;
var arr: array[1..3] of real;
i, z, h: integer;
procedure swap(var x, y: real);
var t: real;
begin t := x; x := y; y := t
end;
begin
writeln('Введите три числа:');
for i := 1 to 3 do read(arr[i]);
for h := 1 to 3 - 1 do
for z := 1 to 3 - h do
if arr[z] > arr[z + 1] then
swap(arr[z], arr[z + 1]);
for i := 1 to 3 do write(arr[i], ' ');
end.
C++
#include <iostream>
using namespace std;
int main()
{
unsigned n;
cin >> n;
cout << n << " - '" << (char)n << "'" << endl;
return 0;
}
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.