multigen.cpp 776 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * It is another type of generators. It writes several files named
  3. * as test indices.
  4. *
  5. * For example, this generator writes 10 files (tests) from 1 to 10.
  6. * This type of generators is supported by Polygon too, but
  7. * stdout-generators are more preferred.
  8. *
  9. * The generator is for A+B problem, generates 10 tests where each
  10. * number is between 1 and 100, and tests grow with indices.
  11. */
  12. #include "testlib.h"
  13. using namespace std;
  14. void writeTest(int test)
  15. {
  16. startTest(test);
  17. int a = rnd.next(1, test * test);
  18. int b = rnd.next(1, test * test);
  19. println(a, b);
  20. }
  21. int main(int argc, char* argv[])
  22. {
  23. registerGen(argc, argv, 1);
  24. for (int i = 1; i <= 10; i++)
  25. writeTest(i);
  26. return 0;
  27. }