fork download
  1. /*
  2. * @Author: hungeazy
  3. * @Date: 2026-03-04 23:24:15
  4. * @Last Modified by: hungeazy
  5. * @Last Modified time: 2026-03-14 17:10:44
  6. */
  7. #include <bits/stdc++.h>
  8. using namespace std;
  9. #define int long long
  10. int a[11];
  11.  
  12. signed main()
  13. {
  14. ios_base::sync_with_stdio(false);
  15. cin.tie(NULL); cout.tie(NULL);
  16. int n = 10;
  17. for (int i = 1; i <= n; i++) cin >> a[i];
  18. int mx = -1001, mn = 1001, sum = 0;
  19. for (int i = 1; i <= n; i++)
  20. {
  21. sum += a[i];
  22. if (mx < a[i]) mx = a[i];
  23. if (mn > a[i]) mn = a[i];
  24. }
  25. double A = sum*1.0/n;
  26. int B = sum, C = mx-mn;
  27. cout << fixed << setprecision(2) << abs(A*C-B);
  28. return 0;
  29. }
Success #stdin #stdout 0s 5312KB
stdin
Standard input is empty
stdout
0.00