nval.cpp 674 B

1234567891011121314151617181920212223242526272829
  1. /**
  2. * Validates that the first line contains the integer between 1 and 10^5, inclusive.
  3. * The second line should contains space-separated sequence of integers between -10^15 and 10^15, inclusive.
  4. * Also validates that file ends with EOLN and EOF.
  5. */
  6. #include "testlib.h"
  7. using namespace std;
  8. int main()
  9. {
  10. registerValidation();
  11. int n = inf.readInt(1, 100000, "n");
  12. inf.readEoln();
  13. for (int i = 0; i < n; i++)
  14. {
  15. inf.readLong(-1000000000000000LL, 1000000000000000LL, format("a[%d]", i + 1));
  16. if (i + 1 < n)
  17. inf.readSpace();
  18. }
  19. inf.readEoln();
  20. inf.readEof();
  21. return 0;
  22. }