Program asd;
uses crt;
var a,b,c,max:integer; r:real;
begin
Write('Введите число A: ');
Readln(a);
Write('Введите число B: ');
Readln(b);
Write('Введите число C: ');
Readln(c);
If a>=b then max:=a
else
max:=b;
If c>max then
max:=c;
r:=a+b+c;
If (A>B) and (B>C) and (C>0) then
Writeln('A= ',a*2,' B= ',b*2,' C= ',c*2);
If (A<0) and (B<0) and (C<0) and (A<>B) and (B<>C) and (C<>A) then
A:=max;
B:=max;
C:=max;
Writeln('A= ',a,' B= ',b,' C= ',c);
end
Writeln('Symma: ',r);
Объяснение:
1)
var
a: integer;
even,odd: byte;
readln(a);
even := 0;
odd := 0;
while a > 0 do begin
if (a mod 2) = 0 then
even := even + 1
odd := odd + 1;
a := a div 10;
end;
writeln('even: ', even);
writeln('odd: ', odd);
end.
2)
n, m: longint;
a: byte;
readln(n);
m := 0;
while n>0 do begin
a := n mod 10;
n := n div 10;
m := m*10 + a;
writeln(m);
readln;
3)
a,b,c,i,n: integer;
write('n = ');
a := 0;
write(a,' ');
b := 1;
write(b,' ');
for i:=3 to n do begin
write(a+b,' ');
c := b;
b := a + b;
a := c
readln
Program asd;
uses crt;
var a,b,c,max:integer; r:real;
begin
Write('Введите число A: ');
Readln(a);
Write('Введите число B: ');
Readln(b);
Write('Введите число C: ');
Readln(c);
If a>=b then max:=a
else
max:=b;
If c>max then
max:=c;
r:=a+b+c;
If (A>B) and (B>C) and (C>0) then
Writeln('A= ',a*2,' B= ',b*2,' C= ',c*2);
If (A<0) and (B<0) and (C<0) and (A<>B) and (B<>C) and (C<>A) then
begin
A:=max;
B:=max;
C:=max;
Writeln('A= ',a,' B= ',b,' C= ',c);
end
else
Writeln('Symma: ',r);
end
Объяснение:
Program asd;
uses crt;
var a,b,c,max:integer; r:real;
begin
Write('Введите число A: ');
Readln(a);
Write('Введите число B: ');
Readln(b);
Write('Введите число C: ');
Readln(c);
If a>=b then max:=a
else
max:=b;
If c>max then
max:=c;
r:=a+b+c;
If (A>B) and (B>C) and (C>0) then
Writeln('A= ',a*2,' B= ',b*2,' C= ',c*2);
If (A<0) and (B<0) and (C<0) and (A<>B) and (B<>C) and (C<>A) then
begin
A:=max;
B:=max;
C:=max;
Writeln('A= ',a,' B= ',b,' C= ',c);
end
else
Writeln('Symma: ',r);
end
1)
var
a: integer;
even,odd: byte;
begin
readln(a);
even := 0;
odd := 0;
while a > 0 do begin
if (a mod 2) = 0 then
even := even + 1
else
odd := odd + 1;
a := a div 10;
end;
writeln('even: ', even);
writeln('odd: ', odd);
end.
2)
var
n, m: longint;
a: byte;
begin
readln(n);
m := 0;
while n>0 do begin
a := n mod 10;
n := n div 10;
m := m*10 + a;
end;
writeln(m);
readln;
end.
3)
var
a,b,c,i,n: integer;
begin
write('n = ');
readln(n);
a := 0;
write(a,' ');
b := 1;
write(b,' ');
for i:=3 to n do begin
write(a+b,' ');
c := b;
b := a + b;
a := c
end;
readln
end.
Объяснение: