Delphi / Pascalfunction mySimpleDigit(a: integer):boolean;var i: integer;beginfor i:=sqrt(a) downto 1 doif not (a mod i = 0) then mySimpleDigit:=false else mySimpleDigit:=true;end;var i,n,s: integer;beginwrite('Введите число: ');readln(n);if ((n>1) and (n<1000000)) thenbegins:=0;for i:=2 to n-1 doif ((n mod i = 0) and (mySimpleDigit(i) = true)) then s:=s+i;end;writeln('Сумма всех простых делителей: ', s);readln;end.C++#include <cmath>#include <iostream>using namespace std;bool mySimpleDigit(unsigned a) {for (unsigned i =sqrt(a); i > 1; i--)if (!(a % i)) return false;return true;}int main() {unsigned n,s;cin >> n;if ((n>1) && (n<1000000)) {s=0;for (unsigned i=2; i<=n; i++)if ((n%i==0) && (mySimpleDigit(i)==true)) s+=i;cout << "Summa vsex prostix deliteley: " << s;} else cout << "Vvedite drugoe chislo";return 0;}