init commit
This commit is contained in:
Executable
+19
@@ -0,0 +1,19 @@
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
#include <cmath>
|
||||
|
||||
int main() {
|
||||
double tmp, arip = 0, squar = 0;
|
||||
int n = 0;
|
||||
while (std::cin >> tmp) {
|
||||
++n;
|
||||
arip += (tmp - arip) / n;
|
||||
squar += (tmp * tmp - squar) / n;
|
||||
}
|
||||
|
||||
std::cout << std::setprecision(10);
|
||||
|
||||
std::cout << arip << std::endl << std::sqrt(squar - arip * arip) << std::endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user