主题:[原创]帮忙看一下编译的错误,提示信息看不懂
program xingDaorl; {there are some errors,now i can't find them}
CONST
R=4;
S=4;
E=0.01;
TYPE
P=ARRAY[1..R,1..S] OF REAL;
Q=ARRAY[1..R] OF REAL;
ALFA=ARRAY[1..R] OF REAL;
M=ARRAY[1..S] OF REAL;
N=ARRAY[1..R] OF REAL;
VAR
C,CN_1,CN:REAL;
I,J:INTEGER;
FUNCTION MAX(T:ALFA):REAL;
VAR
TI,MAX1:REAL;
BEGIN
MAX1:=T[1];
FOR I:=2 TO R DO
BEGIN
TI:=T[I];
IF (TI>MAX1) THEN MAX1:=TI
END;
MAX:=MAX1
END;
BEGIN
CN_1:=0;
CN:=CN_1+E+1;
FOR I:=1 TO R DO
FOR J:=1 TO S DO
READ(P[I,J]); {may be there is some other error in the other place }
FOR I:=1 TO R DO
READLN(Q[I]);
WHILE CN-CN_1>=E DO
BEGIN
FOR J:=1 TO S DO
BEGIN
M[J]:=0;
FOR I:=1 TO R DO
M[J]:=M[J]+Q[I]*P[I,J]
END;
FOR I:=1 TO R DO
BEGIN
N[I]:=0;
FOR J:=1 TO S DO
BEGIN
IF (P[I,J]<>0)OR (P[I,J]/M[J]<>0) THEN
N[I]:=N[I]+P[I,J]*LN(P[I,J]/M[J])
ELSE N[I]:=N[I]
END ;
ALFA[I]:=EXP(N[I])
END;
K:=0;
FOR I:=1 TO R DO
K:=K=Q[I]*ALFA[I];
CN:=LN(K);
CN+1:=LN(MAX(ALFA));
FOR I:= 1 TO R DO
Q[I]:=(Q[I]*ALFA[I])/K
END;
C:=CN;
WRITELN('C=',C)
END.
CONST
R=4;
S=4;
E=0.01;
TYPE
P=ARRAY[1..R,1..S] OF REAL;
Q=ARRAY[1..R] OF REAL;
ALFA=ARRAY[1..R] OF REAL;
M=ARRAY[1..S] OF REAL;
N=ARRAY[1..R] OF REAL;
VAR
C,CN_1,CN:REAL;
I,J:INTEGER;
FUNCTION MAX(T:ALFA):REAL;
VAR
TI,MAX1:REAL;
BEGIN
MAX1:=T[1];
FOR I:=2 TO R DO
BEGIN
TI:=T[I];
IF (TI>MAX1) THEN MAX1:=TI
END;
MAX:=MAX1
END;
BEGIN
CN_1:=0;
CN:=CN_1+E+1;
FOR I:=1 TO R DO
FOR J:=1 TO S DO
READ(P[I,J]); {may be there is some other error in the other place }
FOR I:=1 TO R DO
READLN(Q[I]);
WHILE CN-CN_1>=E DO
BEGIN
FOR J:=1 TO S DO
BEGIN
M[J]:=0;
FOR I:=1 TO R DO
M[J]:=M[J]+Q[I]*P[I,J]
END;
FOR I:=1 TO R DO
BEGIN
N[I]:=0;
FOR J:=1 TO S DO
BEGIN
IF (P[I,J]<>0)OR (P[I,J]/M[J]<>0) THEN
N[I]:=N[I]+P[I,J]*LN(P[I,J]/M[J])
ELSE N[I]:=N[I]
END ;
ALFA[I]:=EXP(N[I])
END;
K:=0;
FOR I:=1 TO R DO
K:=K=Q[I]*ALFA[I];
CN:=LN(K);
CN+1:=LN(MAX(ALFA));
FOR I:= 1 TO R DO
Q[I]:=(Q[I]*ALFA[I])/K
END;
C:=CN;
WRITELN('C=',C)
END.