Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var
- XArr, YArr, MArr: array [0 .. 5] of Real;
- Xc, Yc, MSum, XSum, YSum: Real;
- I: Integer;
- procedure Calc();
- begin
- Xc := XSum / MSum;
- Yc := YSum / MSum;
- end;
- begin
- MSum := 0;
- XSum := 0;
- YSum := 0;
- for I := 0 to 5 do
- begin
- Write('x', I, ' = ');
- Readln(XArr[I]);
- Write('y', I, ' = ');
- Readln(YArr[I]);
- Write('m', I, ' = ');
- Readln(MArr[I]);
- XSum := XSum + (XArr[I] * MArr[I]);
- YSum := YSum + (YArr[I] * MArr[I]);
- MSum := MSum + MArr[I];
- end;
- Calc();
- Writeln('X = ', Xc:0:3);
- Writeln('Y = ', Yc:0:3);
- Readln;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement