CoCalc Public Filestmp / a.fOpen in with one click!
Authors: Harald Schilly, ℏal Snyder, William A. Stein
1
C AREA OF A TRIANGLE - HERON'S FORMULA
2
C INPUT - CARD READER UNIT 5, INTEGER INPUT
3
C OUTPUT - LINE PRINTER UNIT 6, REAL OUTPUT
4
C INPUT ERROR DISPAY ERROR OUTPUT CODE 1 IN JOB CONTROL LISTING
5
INTEGER A,B,C
6
READ(5,501) A,B,C
7
501 FORMAT(3I5)
8
IF(A.EQ.0 .OR. B.EQ.0 .OR. C.EQ.0) STOP 1
9
S = (A + B + C) / 2.0
10
AREA = SQRT( S * (S - A) * (S - B) * (S - C))
11
WRITE(6,601) A,B,C,AREA
12
601 FORMAT(4H A= ,I5,5H B= ,I5,5H C= ,I5,8H AREA= ,F10.2,12HSQUARE UNITS)
13
STOP
14
END