linkedin facebook linkedin facebook nod32

Fortran90 tilida chiqarish operatori

Muallif: Mengliyev Sh.

Qo`shilgan sana: 2016-11-02

Fortran90 tilida chiqarish operatori

program main

call vaqt ( )

write ( *, '(a)' ) ' FORTRAN90 versiyada.'
call test01 ( )

 

stop
end
subroutine test01

!
real x1
real x2
real x3
real x4
real x5
real x6
real x7
real x8
real x9
real x10
real x11
real x12

x1 = 10.9D+00
x2 = 0.99D+00 * x1
x3 = 10.0D+20
x4 = 1.0D+101

x5 = 10.01D+01
x6 = 1.01D+00 * x5
x7 = 100.0D+00 * x5
x8 = 1.0D-101

x9 = 1.0D+10
x10 = 1.0D-98
x11 = 123456789.0D+00
x12 = 0.123456789D+00

 

write ( *, '(a)' ) ' WRITE(*,*) chiqarish operatori formati:'
write ( *, * ) ' X1 = ', x1
write ( *, * ) ' X2 = ', x2
write ( *, * ) ' X3 = ', x3
write ( *, * ) ' X4 = ', x4
write ( *, * ) ' X5 = ', x5
write ( *, * ) ' X6 = ', x6
write ( *, * ) ' X7 = ', x7
write ( *, * ) ' X8 = ', x8
write ( *, * ) ' X9 = ', x9
write ( *, * ) ' X10 = ', x10
write ( *, * ) ' X11 = ', x11
write ( *, * ) ' X12 = ', x12

write ( *, '(a)' ) ' WRITE(*,''(G24.10)'') chiqarish operatori formati:'
write ( *, '(a,g24.10)' ) ' X1 = ', x1
write ( *, '(a,g24.10)' ) ' X2 = ', x2
write ( *, '(a,g24.10)' ) ' X3 = ', x3
write ( *, '(a,g24.10)' ) ' X4 = ', x4
write ( *, '(a,g24.10)' ) ' X5 = ', x5
write ( *, '(a,g24.10)' ) ' X6 = ', x6
write ( *, '(a,g24.10)' ) ' X7 = ', x7
write ( *, '(a,g24.10)' ) ' X8 = ', x8
write ( *, '(a,g24.10)' ) ' X9 = ', x9
write ( *, '(a,g24.10)' ) ' X10 = ', x10
write ( *, '(a,g24.10)' ) ' X11 = ', x11
write ( *, '(a,g24.10)' ) ' X12 = ', x12

write ( *, '(a)' ) ' WRITE(*,''(D24.10)'') chiqarish operatori formati:'
write ( *, '(a,d24.10)' ) ' X1 = ', x1
write ( *, '(a,d24.10)' ) ' X2 = ', x2
write ( *, '(a,d24.10)' ) ' X3 = ', x3
write ( *, '(a,d24.10)' ) ' X4 = ', x4
write ( *, '(a,d24.10)' ) ' X5 = ', x5
write ( *, '(a,d24.10)' ) ' X6 = ', x6
write ( *, '(a,d24.10)' ) ' X7 = ', x7
write ( *, '(a,d24.10)' ) ' X8 = ', x8
write ( *, '(a,d24.10)' ) ' X9 = ', x9
write ( *, '(a,d24.10)' ) ' X10 = ', x10
write ( *, '(a,d24.10)' ) ' X11 = ', x11
write ( *, '(a,d24.10)' ) ' X12 = ', x12

 

write ( *, '(a)' ) ' WRITE(*,''(E24.10)'') chiqarish operatori formati:'
write ( *, '(a,e24.10)' ) ' X1 = ', x1
write ( *, '(a,e24.10)' ) ' X2 = ', x2
write ( *, '(a,e24.10)' ) ' X3 = ', x3
write ( *, '(a,e24.10)' ) ' X4 = ', x4
write ( *, '(a,e24.10)' ) ' X5 = ', x5
write ( *, '(a,e24.10)' ) ' X6 = ', x6
write ( *, '(a,e24.10)' ) ' X7 = ', x7
write ( *, '(a,e24.10)' ) ' X8 = ', x8
write ( *, '(a,e24.10)' ) ' X9 = ', x9
write ( *, '(a,e24.10)' ) ' X10 = ', x10
write ( *, '(a,e24.10)' ) ' X11 = ', x11
write ( *, '(a,e24.10)' ) ' X12 = ', x12

return
end
subroutine vaqt ( )

character ( len = 8 ) ampm
integer ( kind = 4 ) d
integer ( kind = 4 ) h
integer ( kind = 4 ) m
integer ( kind = 4 ) mm
character ( len = 9 ), parameter, dimension(12) :: month = (/ &
'January ', 'February ', 'March ', 'April ', &
'May ', 'June ', 'July ', 'August ', &
'September', 'October ', 'November ', 'December ' /)
integer ( kind = 4 ) n
integer ( kind = 4 ) s
integer ( kind = 4 ) values(8)
integer ( kind = 4 ) y

call date_and_time ( values = values )

y = values(1)
m = values(2)
d = values(3)
h = values(5)
n = values(6)
s = values(7)
mm = values(8)

if ( h < 12 ) then
ampm = 'AM'
else if ( h == 12 ) then
if ( n == 0 .and. s == 0 ) then
ampm = 'Noon'
else
ampm = 'PM'
end if
else
h = h - 12
if ( h < 12 ) then
ampm = 'PM'
else if ( h == 12 ) then
if ( n == 0 .and. s == 0 ) then
ampm = 'Midnight'
else
ampm = 'AM'
end if
end if
end if

write ( *, '(i2,1x,a,1x,i4,2x,i2,a1,i2.2,a1,i2.2,a1,i3.3,1x,a)' ) &
d, trim ( month(m) ), y, h, ':', n, ':', s, '.', mm, trim ( ampm )

return
end

188 marta o`qildi.

Parol:
Eslab qolish.


Ro`yhatdan o`tish

testing

+998915878681

Siz o`z maxsulotingizni 3D reklama ko`rinishda bo`lishini xohlaysizmi? Unda xamkorlik qilamiz.

3D Reklama


Рейтинг@Mail.ru
Рейтинг@Mail.ru

Besucherzahler
счетчик посещений