From: mhiroshi@tansei.cc.u-tokyo.ac.jp (H. Murakami)
Newsgroups: fj.lang.fortran
Subject: Re: FORTRAN 77 Quiz. (10) (answer)
Date: 22 Aug 92 13:07:02 GMT
Distribution: fj
Organization: Hokkaido Univ. However I am subject to tansei for JUNET.

Subject: Re: FORTRAN 77 Quiz. (10) (answer)

>FORTRAN 77 $BJ8K!%/%$%:(J (10)
>----$B$3$3$+$i$h(J---
>      SUBROUTINE LLL()
>      COMMON /COMMON/ COMMON(10)
>      SAVE /COMMON/
>      CHARACTER*15 FORMAT
>      NFORMAT=5
>*
>      FORMAT = '(1X,F10.5)'
>      COMMON(1) = 1.5
>      WRITE(NFORMAT,FORMAT) COMMON(1), (COMMON(2)*2)
>      END
>----$B$3$3$^$G$h(J---

$B2sEz0F(J:

	1) NFORMAT $B$H$$$&JQ?tL>$O(J6$BJ8;z$r1[$($F$$$k(J.

$B30$K$O0-$$$H$3$m$O$J$$(J($BB?J,(J).

$B$9$s$^$;$s(J. $BFs$D0J>eM-$k$H$$$C$?$N$O!V4V0c$$!W$G$7$?(J. $B0l$D$@$1$G$7$?(J.

( $B$H$$$&(J"$B4V0c$$(J"$B$r4^$a$l$PFs$D$K$J$k(J? $B$9$k$H!V4V0c$$!W$,0l$D$J$/$J$j(J
  $B4V0c$$$O0l$D$K$J$k(J. $B$9$k$H(J,$B4V0c$$$OFs$D$K$J$k(J.$B$9$k$H(J
  $B4V0c$$$O0l$D$K$J$k(J. $B$9$k$H(J,$B4V0c$$$OFs$D$K$J$k(J.$B$9$k$H(J....
  $B$H$$$&$h$&$J%a%?%a%?$J>iCL$O$5$FCV$-(J. )

$BCm(J1:
$B0z$-?t$N$J$$(J $B%5%V%k!<%A%s$O0z?t%j%9%H$rIU$1$J$/$F$b$"$k$$$O(J () $B$r$D$1$F$b(J
$B$I$A$i$G$b$h$$(J. $B8F$S=P$7$N$H$-$b(J  
	CALL SUB
	CALL SUB()
$B$N$I$A$i$G$b$h$$(J. ($B$*$=$i$/0l$D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y$F$NI{%W%m%0%i%`$K$*$$$F(J,
>$B$=$N6&DL%V%m%C%/L>$r(JSAVE$BJ8$K;XDj$7$J$1$l$P$J$i$J$$(J.  
<=== ($B$3$l$O$G$+$$%W%m%0%i%`$G7zA0$I$&$j$K$A$c$s$H$d$k$N$O$J$+$J$+?I$$(J....)

$B$D$^$j6&DL%V%m%C%/Fb$N5-210h$rCM$rJ]B8$9$k$h$&$K;XDj$7$?$$$H$-$K$O(J,
$B$=$N6&DL%V%m%C%/A4BN$rCM$rJ]B8$9$k$h$&$K;XDj$9$k$7$+$J$/(J,
$B<P@~$G6&DL%V%m%C%/L>$r0O$s$@$b$N$r(JSAVE$BJ8$K=q$/(J.

$BNc$($P(J
      SUBROUTINE SUB
      COMMON /GEORGE/ BUSH(1993)
      SAVE BUSH
      BUSH(1) = 1.2
      END
$B$N$h$&$J%W%m%0%i%`$O0cH?$H$$$&$3$H$K$J$k(J. 
( SAVE BUSH $B$G$O$J$/$F(J SAVE /GEORGE/ $B$H$7$J$1$l$P$$$1$J$$(J. )

SAVE$B;XDj$5$l$?6&DL%V%m%C%/$,$[$+$NI{%W%m%0%i%`$K8=$o$l$k$J$i(J,
$B$9$Y$F$=$l$i$NI{%W%m%0%i%`$G$=$N6&DL%V%m%C%/$O(JSAVE$B;XDj$,$5$l$F$$$J$$$H(J
(FORTRAN77$B$N5,3J$H$7$F$O(J)$B$$$1$J$$(J.

$BNc$($P(J
       SUBROUTINE SUB1
       COMMON /RONALD/ REAGAN
       SAVE /RONALD/
       REAGAN = 1.0
       END
       SUBROUTINE SUB1
       COMMON /RONALD/ GORBY
       GORBY = GORBY + 1
       END
$B$O@5$7$/$J$$$3$H$K$J$k(J.

=========
$B$5$F(J, QUIZ10 $B$G$OK\Ev$O<!$NMM$J$3$H$r$7$?$+$C$?(J.

$B4V0c$$$r;XE&$;$h(J.
--------------------------
      PROGRAM MAIN
      X = 1.0
      WRITE(*,*) (X,X)
      END
--------------------------

$B<!$N$h$&$K$9$l$P$I$&$+(J?
--------------------------
      PROGRAM MAIN
      PARAMETER ( X = 1.0 )
      WRITE(*,*) (X,X)
      END
--------------------------

$B$5$i$K<!$N$b$N$O$I$&$+(J.
--------------------------
      PROGRAM MAIN
      READ(*,*) (X)
      END
--------------------------