|
|
back to boardhow to explain it??? I got WA #4 with such code: #include <cstdio> #include <iostream> #include <cmath> using namespace std; int main() { int n; double a, sum = 0.0; scanf("%d", &n); for (int i = 0; i < n; i++) { scanf("%le", &a); sum += a; } printf("%.15e", sum / n); return 0; } WA #5 with such code: #include <cstdio> #include <iostream> #include <cmath> using namespace std; int main() { int n; double a, sum = 0.0; scanf("%d", &n); for (int i = 0; i < n; i++) { scanf("%le", &a); sum += a; } printf("%.7e", sum / n); return 0; } WA #6 with such code: #include <cstdio> #include <iostream> #include <cmath> using namespace std; int main() { int n; double a, sum = 0.0; scanf("%d", &n); for (int i = 0; i < n; i++) { scanf("%le", &a); sum += a; } printf("%.8e", sum / n); return 0; } AC with such code: #include <cstdio> #include <iostream> #include <cmath> using namespace std; int main() { int n; double a, sum = 0.0; scanf("%d", &n); for (int i = 0; i < n; i++) { scanf("%le", &a); sum += a; } printf("%.15e", sum / n); return 0; } But, connecting to the problem statements, "The offset should be printed with at least six digits after decimal point." |
|
|