diff options
author | Erich Eckner <git@eckner.net> | 2019-10-29 15:59:41 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2019-10-29 15:59:41 +0100 |
commit | 286d933527eb4d3aeb72e16aa5b8b621a4ef6259 (patch) | |
tree | f48f37adcd94ec6f3e1ab4785f550c047d312a9d | |
download | mittle-286d933527eb4d3aeb72e16aa5b8b621a4ef6259.tar.xz |
initial commit
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | mittle.pas | 31 |
2 files changed, 33 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2f1283c --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +mittle +*.o diff --git a/mittle.pas b/mittle.pas new file mode 100644 index 0000000..d488e2f --- /dev/null +++ b/mittle.pas @@ -0,0 +1,31 @@ +program mittle; + +uses + lowlevelunit, SysUtils; + +var + Zeile: ansiString; + Zahl,Summe,QSumme: extended; + Anzahl: longint; + +begin + +while not eof do begin + readln(Zeile); + + Anzahl:=0; + Summe:=0; + QSumme:=0; + + write(erstesArgument(Zeile,' ',false)); + while Zeile<>'' do begin + inc(Anzahl); + Zahl:=strToFloat(erstesArgument(Zeile,' ',false)); + Summe:=Summe+Zahl; + QSumme:=QSumme+sqr(Zahl); + end; + writeln(' '+floatToStr(Summe/Anzahl)+' '+floatToStr(QSumme/Anzahl-sqr(Summe/Anzahl))); + +end; + +end. |