Var c,i:integer;
function sov(k:integer):boolean;
var j,s:integer;
begin
result:=false;
s:=0;
for j:=1 to k div 2 do if k mod j=0 then s:=s+j;
if s=k then result:=true;
end;
begin
read(c);
i:=1;
while (sov(c+i)=false) and (sov (c-i)=false) do i:=i+1;
if sov(c+i)=true then writeln(c+i) else writeln(c-i)
<span>end.</span>
<em>// PascalABC.NET 3.3, сборка 1583 от 25.11.2017</em>
<em>// Внимание! Если программа не работает, обновите версию!</em>
uses GraphABC;
begin
Window.SetSize(800,600);
Draw(x->x=1?1.0:10/(x-1)+5*Sin(x),-20.0,20.0)
end.
<u>Результат приведен во вложении</u>
ответ №3 - 5
(5*(5-8)>-25+2*5)→(5>7)- истина (из лжи следует ложь=истина)
#include <stdio.h>
#include <stdlib.h>
int main()
{
int a,b,c,d1,d2,d=0,n=0;
srand (time(NULL));
a = rand() % 50 + 1;
b = rand() % 50 + 1;
c = rand() % 20 + 1;
while (c>a) a = rand() % 50 + 1;
while (c>b) b = rand() % 50 + 1;
printf ("%d %d %d\n", a, b, c);
d1 = a; d2 = b;
while (d1>=c){
d2 = b;
while (d2>=c){ n++; d2 -= c; }
d1 -= c;
}
printf("%d\n", n);
for (int i=0; i<(10-1); i++) d += n;
d = -d;
printf("%d", d);
return 0;
}
Пример:
<span>27 42 4
60
-540</span>