multigen.cpp 749 B

123456789101112131415161718192021222324252627282930
  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. startTest(test);
  16. int a = rnd.next(1, test * test);
  17. int b = rnd.next(1, test * test);
  18. println(a, b);
  19. }
  20. int main(int argc, char *argv[]) {
  21. registerGen(argc, argv, 1);
  22. for (int i = 1; i <= 10; i++)
  23. writeTest(i);
  24. }