1
0

multigen.cpp 801 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 supported by Polygon too, but I believe
  7. * that stdout-generators are more preferred.
  8. *
  9. * The generator 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. #include <iostream>
  14. using namespace std;
  15. void writeTest(int test)
  16. {
  17. startTest(test);
  18. cout << rnd.next(1, test * test)
  19. << " " << rnd.next(1, test * test) << endl;
  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. }