1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
| program main
integer :: i,j real :: x,y double precision :: m,n complex :: o,p logical :: t,f character :: a,b
i = sqrt(4.0) print *, "4.0开方=(整型)",i j = sin(2.0) j1 = cos(2.0); j2 = asin(1.0); j3 = acos(1.0) j4 = tan(2.0); j5 = atan(2.0) write(*,*) "2.0的正弦函数值=(整型)",j,j1,j2,j3,j4,j5
x = exp(6.0) write(*,*) "6.0的e指数(实型)=",x
y = log(3.0) y1 = log10(3.0) y2 = alog(3.0) y3 = alog10(3.0) write(*,*) "3.0的log值(实型)=",y,y1,y2,y3
m = abs(-3.333); m1 = int(real(-3)) write(*,*) m,m1
n = mod(5,2) n1 = sign(5,2) n2 = max(2,5,6,8,9,44) n3 = max0(2,5,6,8,9,44) n4 = min(2,5,6,8,9,44) n5 = min0(2,5,6,8,9,44) write(*,*) n,n1,n2,n3,n4,n5
end program main
|