Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- #include <iomanip>
- int main() {
- double sum = 0, square_sum = 0, now, amount = 0;
- while (true) {
- std::cin >> now;
- if (now == 0) {
- break;
- }
- ++amount;
- sum += now;
- square_sum += now * now;
- }
- std::cout << std::setprecision(12) << std::sqrt((square_sum - sum * sum / amount) / (amount - 1));
- }
Advertisement
Add Comment
Please, Sign In to add comment