Function IsSimple(n: Word): Boolean; Var T: Word; Begin IsSimple := True; T := 2; While (T < n) Do Begin If (n mod T = 0) then Begin IsSimple := False; Break; End Else Inc(T); End; End;
Begin ClrScr; Repeat Write('Введите четное N > 2: '); ReadLn(k); Until (not Odd(k)); For i := 2 to k div 2 do Begin If (IsSimple(i) and IsSimple(k - i)) then Begin Writeln('Гипотеза Гольдбаха подтверждена!'); Writeln(k,' = ',i,' + ',k - i); Break; End; End; ReadKey; End.