[an error occurred while processing this directive]
[an error occurred while processing this directive]program main write(*,*) "Hello!" end変数。
program main integer i, j, k i = 2 j = 3 k = i + j write(*,*) "i + j = ", k end関数。
program main integer i, j, k integer sample_f k = f(1,2) write(*,*) "k=",k end c c integer function sample_f(a, b) integer a, b f = a * b write(*,*) '(' , a, ',' , b, ',', f, ')' end
do i=1,10 write(*,*) A(i) end doと書くところを
write(*,*) (A(i),i=1,10)と書けます。二次元なら
write (*,*) ((A(i,j),j=1,10),i=1,10)
real*8, allocatable A() ... allocate(A(10)) do i=1,10 A(i)=i*i end do write(*,*) (A(i),i=1,10)二次元配列にも使えます
real*8, allocatable A(:,:) ... allocate(A(0:9,0:9))