SHARE
TWEET

pr5

starm100 Dec 4th, 2018 (edited) 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. program pr5
  2. real::x0,xk,dx,y0,yk,dy,y,x,a
  3. integer::i,j,imax,jmax
  4. write(*,*) 'Input x0,xk,dx,y0,yk,dy,a,b'
  5. read(*,*) x0,xk,dx,y0,yk,dy,a,b
  6. jmax=nint((yk-y0)/dy+0.5)+1 !nint- округление к целому
  7. imax=nint((xk-x0)/dx+0.5)+1
  8. do j=1,jmax
  9.     y=yk-(j-1)*dy
  10.     do i=1,imax
  11.         x=x0+(i-1)*dx
  12.         if ((x/a)**2-(y/b)**2<1 .AND. abs(y)<a) then !ваше условие
  13.             write(*,'(a\)') ' /' ! (\)-без перехода на новую строку
  14.         else
  15.             write(*,'(a\)') ' .'
  16.         end if
  17.     end do
  18.     print*,' ' !переход на новую строку
  19. end do
  20. 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
 
Top