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

Поисковые слова: http astrokuban.info astrokuban
program tripos1
implicit none

real :: p1, p2, p3, maths
real :: av1, av2

! read in the marks
read(*,*) p1, p2, p3, maths

! work out the two averages
av1 = p1 + p2 + p3
av2 = av1 + maths
av1 = av1 / 3.0 ; av2 = av2 / 4.0

! use an if statement
if (av2 > av1) then
write(*,*) 'Final average = ',av2
else
write(*,*) 'Final average = ',av1
end if

end program tripos1