#include <iostream>
using std::cout;
using std::cin;
using std::endl;
void test(int);
int main()
{
int number;
cout << "Enter the number: ";
cin >> number;
if(number < 1000)
{
cout << "Error" << endl;
}
else
test(number);
return 0;
}
void test(int number)
{
int a, b, c;
c = number % 10;
number /= 10;
b = number % 10;
number /= 10;
a = number % 10;
cout << a << " * " << b << " * " << c << " = " << (a * b *c) << endl;}
Х=2
у=2-1=1
х=2×1=2
у=1-2=-1
х=2-1=1
Program enot;
const m=15;
var a: array[1..m] of integer;
i, j, k: integer;
begin
for i := 1 to m do
a[i] := random(21)+10;
for i := 1 to m-1 do
for j := 1 to m-i do
if a[j] < a[j+1] then begin
k := a[j];
a[j] := a[j+1];
a[j+1] := k
end;
write ('Отсортированный массив: ');
for i := 1 to m do
write (a[i]:4);
<span>end.</span>
Код PascalABC.NET 3.2:
Var S:string;
i,k:integer;
Begin
Write('Введите строку: ');ReadLn(S);
LowerCase(S);
k:=0;
For i:= 1 to S.Length-2 do
if S[i] = 'д' then
if S[i+1] = 'о' then
if S[i+2] = 'м' then
k:=k+1;
WriteLn(k)
End.
Var
S:string;
i,d1,d2,d3:integer;
Begin
WriteLn('Введите строку:');
ReadLn(S);
i:=0;
Repeat
i+=1
Until S[i] = ' ';
d1:=i-1;
Repeat
i+=1
Until S[i] = ' ';
d2:=i-d1-2;
Repeat
i+=1
Until i = S.Length;
d3:=i-d2-d1-2;
if d3 < d1 then d1:=d3;
if d2 < d1 then d1:=d2;
WriteLn(d1)
End.
const T=50;
var a: array [1..T,1..T] of integer;
i,j,n,m:integer;
begin
write('Введите n: ');
readln(n);
write('Введите m: ');
readln(m);
for i:=1 to n do
for j:=1 to m do readln(a[i,j]);
for i:=1 to n do
for j:=1 to m do if i=j then a[i,j]:=a[i,j]*2;
for i:=1 to n do
begin
for j:=1 to m do write(a[i,j],' ');
writeln;
end;
end.