1
0

validate-using-testset-and-group.cpp 648 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /**
  2. * Validates that input depenging on testset and group.
  3. */
  4. #include "testlib.h"
  5. #include <iostream>
  6. using namespace std;
  7. int main(int argc, char* argv[])
  8. {
  9. registerValidation(argc, argv);
  10. int n, m;
  11. if (validator.testset() == "pretests")
  12. {
  13. n = inf.readInt(1, 10, "n");
  14. inf.readSpace();
  15. m = inf.readInt(1, 10, "m");
  16. }
  17. else
  18. {
  19. n = inf.readInt(1, 100, "n");
  20. inf.readSpace();
  21. m = inf.readInt(1, 100, "m");
  22. }
  23. if (validator.group() == "even-n-and-m")
  24. {
  25. ensure(n % 2 == 0);
  26. ensure(m % 2 == 0);
  27. }
  28. inf.readEoln();
  29. inf.readEof();
  30. }