Program prog;
Uses crt;
var n,s: integer;
begin
clrscr;
write('n = ');
readln(n);
repeat
s:=(n mod 10)+s;
n:=n div 10;
until
n=0;
writeln;
writeln('S = ', abs(s));
readln;
end.
Ответ:
Задание 1
a = int(input())
b = int(input())
c = int(input())
if (a % 2 == 0 and b % 2 != 0) or (a % 2 != 0 and b % 2 == 0):
print("YES")
elif (a % 2 == 0 and c % 2 != 0) or (a % 2 != 0 and c % 2 == 0):
print("YES")
elif (b % 2 == 0 and c % 2 != 0) or (b % 2 != 0 and c % 2 == 0):
print("YES")
else:
print("NO")
Задание 2
Var i,j,t:integer;
a:array[1..3] of integer;
Begin
for i:=1 to 3 do
readln(a[i]);
for i:=1 to 3 do
for j:=i+1 to 3 do
if a[i]>=a[j] then
begin
t:=a[i];
a[i]:=a[j];
a[j]:=t;
end;
for i:=1 to 3 do
write(a[i],' ');
End.
Объяснение:
калькулятор - вычислительное устройство
Язык СИ:
#include<stdio.h>
#include<math.h>
int main(){
long double x,y;
scanf("%Lf",&x);
if(x<=-10)y=x*x+25-x;
else if(-10<x && x<=10)y=3+fabsl(x);
else y=1/x;
printf("%Lg\n",y);
return 0;
}