PROGRAM BT1_3 PARAMETER (NMAX=100) REAL X(NMAX), TB,P_OVER_TB,P_LOWER_TB,P_OVER_1500 INTEGER NAM(NMAX),N,I OPEN(1,FILE='C:\MASTER\G_TR\BAITAP~1\NEW\BANG1.TXT') READ(1,*) READ(1,*) READ(1,*)N READ(1,*)((NAM(I),X(I)), I=1,N) TB = AVER(X,N) P_OVER_TB = (1.0 - P_LOWER(X,N,TB))*100.0 P_LOWER_TB = P_LOWER(X,N,TB)*100.0 P_OVER_1500 = (1.0 - P_LOWER(X,N,1500.0))*100.0 WRITE(*,'(" LUONG MUA TRUNG BINH R = ",F12.2," (mm)")') TB WRITE(*,'(" XAC SUAT P(R > TB) = ",F12.2," (% )")') P_OVER_TB WRITE(*,'(" XAC SUAT P(R < TB) = ",F12.2," (% )")') P_LOWER_TB WRITE(*,'(" XAC SUAT P(R > 1500) = ",F12.2," (% )")') P_OVER_1500 END FUNCTION AVER(X,N) C... CHUONG TRINH NAY TINH TRUNG BINH SO HOC CUA CHUOI C... DU LIEU VAO LA MANG X DO DAI N CHUA SO LIEU QUAN TRAC C... CUA BIEN NGAU NHIEN X INTEGER N, I REAL X(N) ! MANG CHUA SO LIEU BAN DAU REAL TMP TMP = 0.0 DO I = 1,N TMP = TMP + X(I) END DO AVER = TMP/REAL(N) RETURN END c FUNCTION P_LOWER(X,N,X0) C... CHUONG TRINH NAY TINH UOC LUONG XAC SUAT CUA SU KIEN C... P(X