acmp.cpp 436 B

1234567891011121314151617
  1. #include "testlib.h"
  2. #include <cmath>
  3. const double EPS = 1.5E-6;
  4. int main(int argc, char *argv[]) {
  5. setName("compare two doubles, maximal absolute error = %.10f", EPS);
  6. registerTestlibCmd(argc, argv);
  7. double ja = ans.readDouble();
  8. double pa = ouf.readDouble();
  9. if (fabs(ja - pa) > EPS + 1E-15)
  10. quitf(_wa, "expected %.10f, found %.10f", ja, pa);
  11. quitf(_ok, "answer is %.10f", ja);
  12. }