implicit real*8(a-h,o-z) DATA SX/0./,SY/0./,X2/0./,XY/0./ OPEN(5,FILE='minimoscuadrados.txt') OPEN(6,FILE='minimoscuadrados.out') READ(5,*) N 1 FORMAT(I5) DO 170 I=1,N READ(5,*) X,Y 2 FORMAT(2F10.0) SX=SX+X SY=SY+Y X2=X2+X*X XY=XY+X*Y 170 CONTINUE XM=SX/N YM=SY/N A1=(N*XY-SX*SY)/(N*X2-SX*SX) A0=YM-A1*XM WRITE(6,3) A0,A1 3 FORMAT(' ',2F10.3) STOP END