SHARE
TWEET

n11

starm100 Dec 20th, 2018 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. program n11
  2. integer::i,b=1,y=0
  3. integer,parameter::m=3,n=8
  4. real::A(1:m,1:n)
  5. open(101,file='mat.txt',status='old')
  6. do i=1,m
  7.     read(101,*) A(i,:)
  8.     call factorial(A,i,b,y)
  9.     do j=1,n
  10.         write(*,'(f7.2\)') A(i,j)
  11.     end do
  12.     print*, ' '
  13. end do
  14. close(101)
  15. write(*,'(/"Answer ::",i)') b
  16. contains
  17.    
  18.     subroutine factorial(A,i,b,y)
  19.     integer::i,j,y,b
  20.     real,dimension(:,:)::A
  21.     do j=2,n,2
  22.         if (A(i,j).EQ.0) then
  23.             y=y+1
  24.             b=b*y
  25.         end if
  26.     end do
  27.     end subroutine
  28.    
  29. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top