program raf105;
var
a, s: real;
function square(a: real): real;
begin
square:= a*a;
end;
write('Введите сторону квадрата: ');
readln(a);
s:= square(a);
writeln('Его площадь равна ',s);
end.
num10, num2, count_1: integer;
write('Введите десятичное число: ');
readln(num10);
repeat
if (num10 mod 2 = 1) then
count_1:= count_1 + 1;
num10:= num10 div 2;
if num10 = 1 then
inc(count_1)
until num10 <= 1;
writeln('В двоичной записи числа ',count_1,' ед.');
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
1.
program raf105;
var
a, s: real;
function square(a: real): real;
begin
square:= a*a;
end;
begin
write('Введите сторону квадрата: ');
readln(a);
s:= square(a);
writeln('Его площадь равна ',s);
end.
2.
program raf105;
var
num10, num2, count_1: integer;
begin
write('Введите десятичное число: ');
readln(num10);
repeat
if (num10 mod 2 = 1) then
count_1:= count_1 + 1;
num10:= num10 div 2;
if num10 = 1 then
inc(count_1)
until num10 <= 1;
writeln('В двоичной записи числа ',count_1,' ед.');
end.
PascalABC 3.4.2