Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Compile and Execute FORTRAN-95 Online

program one

Implicit none

Real,Dimension(:,:),allocatable:: stroke,lvdt,total

Integer::strokenum,lvdtnum,i,totalnum,maxnum,k,j

!OPEN(1,file="input.txt",ACTION="READ")
!OPEN(2,file="output.txt",ACTION="WRITE",STATUS="new")


read(*,*) strokenum,lvdtnum

totalnum=strokenum+lvdtnum

!maxnum=max(strokenum,lvdtnum)

allocate(stroke(strokenum,3),lvdt(lvdtnum,2),total(totalnum,4))

DO  i=1,strokenum
read(*,*)  stroke(i,1:2)
END DO

DO  i=1,lvdtnum
read(*,*)  lvdt(i,1:2)
END DO


stroke(1:strokenum,3)=222222


write(*,*) ""
write(*,*) "Stroke Matrix is:"
DO  i=1,strokenum
Write(*,*)  stroke(i,1:3)
END DO

write(*,*) ""
write(*,*) "Lvdt Matrix is:"
DO  i=1,lvdtnum
Write(*,*)  lvdt(i,1:2)
END DO

k=1

Do i=1,strokenum


500     if (stroke(i,1)<=lvdt(j,1)) then
        write(*,*) "ddddddddd"
        total(k,1)=stroke(i,1)
        k=k+1
        j=1
        else 
        write(*,*) "ffffffff"
        total(k,1)=lvdt(j,1)
        k=k+1
        j=j+1
        go to 500
        end if
        
        
        

end do   

write(*,*) ""
write(*,*) "total Matrix is:"
DO  i=1,totalnum
Write(*,*)  total(i,1:2)
END DO

end program one

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.