1
0

interactor-a-plus-b.cpp 699 B

12345678910111213141516171819202122232425262728
  1. #include "testlib.h"
  2. #include <iostream>
  3. using namespace std;
  4. int main(int argc, char* argv[])
  5. {
  6. setName("Interactor A+B");
  7. registerInteraction(argc, argv);
  8. // reads number of queries from test (input) file
  9. int n = inf.readInt();
  10. for (int i = 0; i < n; i++)
  11. {
  12. // reads query from test (input) file
  13. int a = inf.readInt();
  14. int b = inf.readInt();
  15. // writes query to the solution, endl makes flush
  16. cout << a << " " << b << endl;
  17. // writes output file to be verified by checker later
  18. tout << ouf.readInt() << endl;
  19. }
  20. // just message
  21. quitf(_ok, "%d queries processed", n);
  22. }