Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Prosti brojevi praktikum nizovi
program ProstiBrojevi; type niz=array[1..50] of integer; var a,b:niz; i,n,k,s:integer; ind:boolean; begin read(n); while(n>0) do begin for i:=1 to n do begin read(a[i]); k:=a[i]; b[i]:=0; while (k>0) do begin b[i]:=b[i]+(k mod 10); k:=k div 10 end end; for i:=1 to n do write(b[i],' '); writeln(); for i:=1 to n do begin ind:=true; k:=2; if (a[i]>2) then begin while(k<=sqrt(a[i])) and ind=true do begin s:=b[i] mod k; if (s=0) and not(b[i]=k) then begin ind:=false; writeln(a[i],' ',i) end; k:=k+1 end end end; read(n) end end.
run
|
edit
|
history
|
help
0
b1
practica 11 ejercicio 4
Primo1
practica 9 ejercicio 10
TanTai11A2@
test24
нун
test29
5 5
Matrix