interactor-a-plus-b.cpp 689 B

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