fork(3) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. char ch = 'x';
  6. int i = 1;
  7. while((ch = getchar()) != EOF)
  8. {
  9. if(i == 5)
  10. {
  11. cout << ch << " ";
  12. i -= 5;
  13. }
  14. ++i;
  15. }
  16. }
Success #stdin #stdout 0s 3144KB
stdin
asdfGasdfGasdfGqq@aG1
stdout
G G G G