fork download
  1. #include <cstdio>
  2. #include <iostream>
  3. using namespace std;
  4.  
  5. int main() {
  6. char name[7] = {};
  7. int age;
  8. cin.get(name ,7).ignore(128, '\n');
  9. name[6] = 0;
  10. (cin >> age).get();
  11.  
  12. cout << name << endl;
  13. cout << age << endl;
  14.  
  15. int c = cin.get();
  16. if(EOF == c)
  17. cout << "EOF" << endl;
  18. else
  19. cout << c << endl;
  20.  
  21. return 0;
  22. }
Success #stdin #stdout 0s 3472KB
stdin
AAAABBBB
23
stdout
AAAABB
23
EOF