reads2.cpp 870 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #include "testlib.h"
  2. using namespace std;
  3. int main(int argc, char * argv[])
  4. {
  5. registerTestlibCmd(argc, argv);
  6. int z = 0;
  7. while (!inf.eof())
  8. {
  9. z++;
  10. if (z % 4 == 0)
  11. printf("%d\n", inf.readChar());
  12. if (z % 4 == 1)
  13. printf("%d\n", inf.curChar());
  14. if (z % 4 == 2)
  15. printf("%s\n", inf.readLine().c_str());
  16. if (z % 4 == 3)
  17. printf("%s\n", inf.readToken().c_str());
  18. }
  19. while (!ouf.seekEof())
  20. {
  21. z++;
  22. if (z % 4 == 3)
  23. printf("%d\n", ouf.readChar());
  24. if (z % 4 == 1)
  25. printf("%d\n", ouf.curChar());
  26. if (z % 4 == 0)
  27. printf("%s\n", ouf.readLine().c_str());
  28. if (z % 4 == 2)
  29. printf("%s\n", ouf.readToken().c_str());
  30. }
  31. printf("Done\n");
  32. quitf(_ok, "ok");
  33. }