REAL DATA(300) REAL DATAMAX INTEGER NDATA,K READ(*,*) NDATA DO K=1,NDATA READ(*,*) DATA(K) END DO CALL SAIDAI(DATA,NDATA,DATAMAX) DO K=1,NDATA WRITE(*,*) DATA(K) END DO WRITE(*,*) "Maximum=",DATAMAX END !============================ SUBROUTINE SAIDAI(N,A,B) REAL A(100),B,TMP INTEGER N,K TMP=A(1) DO K=2,N IF(A(K).GT.TMP) THEN TMP=A(K) ENDIF END DO B=TMP RETURN END