Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.mrao.cam.ac.uk/~rachael/compphys/examples/factors.f90
Дата изменения: Tue Sep 13 13:07:20 2005
Дата индексирования: Tue Oct 2 11:12:29 2012
Кодировка:

Поисковые слова: http astrokuban.info astrokuban
integer i,p,sqrt_p
write(*,*)'Input no. to test'
read(*,*)p

if (mod(p,2)==0) then
write(*,*)p,' is divisible by 2'
stop
endif

sqrt_p=sqrt(real(p))
do i=3,sqrt_p,2
if (mod(p,i)==0) then
write(*,*)p,' is divisible by ',i
stop
endif
enddo
write(*,*)p,' is prime'
end