Advertisement
Racknoss

Гипотеза Гольдбаха. Разложение Ряда Чисел на сумму 2 простых

May 8th, 2015
304
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 1.04 KB | None | 0 0
  1. var
  2.   a, b, c, d, j, i, t:Integer;
  3.  count:Real;
  4. label 1, 2, 3, 4, 5, 6;
  5. Begin
  6. readln (t);
  7. a:=2;
  8. 6:a:=a+2;
  9. count:=0;
  10. b:=0;
  11. 4:1:b:=b+1;
  12. if (b=a) then begin
  13.                count:=(count / 2) ;
  14.                writeln(a,'=' ,round(count));
  15.                if (a=t) then goto 5;
  16.                goto 6;
  17.                end;
  18. c:=1;
  19. 2:c:=c+1;
  20. if (b mod c =0) then goto 1 else
  21.          if (c>sqrt(b)) then begin
  22.                              d:= a-b;
  23.                              j:=round(sqrt(d));
  24.                              if (d=2) or (d=3) then goto 3;
  25.                              for i:=2 to j do
  26.                               begin
  27.                               if (d mod i=0) then begin
  28.                                                   goto 4;
  29.                                                   end;
  30.                               end;
  31.                              3:count:=count+1;
  32.                              goto 4;
  33.                              end
  34.                              else
  35.                              goto 2;
  36. 5:end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement