Var
a:integer;
begin
readln(a);
If (a<10000) and (a>=0) then
If (a>999) then
If ((a div 1000)=(a mod 10)) and ((a div 10 mod 10)=(a div 100 mod 10)) then
writeln('1')
else
writeln('2')
else
If (a>99) and (a<1000) then
If ((a div 100)=(a mod 10)) then
writeln('1')
else
writeln('2')
else
If (a>9) and (a<100) then
If ((a div 10)=(a mod 10)) then
writeln('1')
else
writeln('2')
else
writeln('1')
else
writeln('Неправльное число');
end.
Большое немного решение, может можно и поменьше, но так точно правильно
Sub pp()n1 = 1k1 = 20n2 = 1DoCells(n2, 2) = Cells(n1, 1)n2 = n2 + 1Cells(n2, 2) = Cells(k1, 1)n2 = n2 + 1k1 = k1 - 1n1 = n1 + 1Loop Until n1 > 10End Sub
#include
int main()
{
int i;
cin >> i;
if(i<3 || i==12)
cout << “winter”;
else if(i <6)
cout << “spring”;
else if(i<9)
cout << “summer”;
else
cout << “autumn”;
return 0;
}
Var m:array[1..10] of integer; i,max,cnt:integer;
begin
max := -1000;
write('Massive: ');
for i := 1 to 10 do begin
m[i] := random (11)-5;
write(m[i],' ');
if m[i] > max then begin inc(cnt); max := m[i]; end;
end;
writeln;
writeln('Максимальное число: ',max);
writeln('Всего максимальных чисел: ', cnt);
end.