You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

repeater.c 222B

123456789101112131415
  1. #include <stdio.h>
  2. int main() {
  3. int c;
  4. int p1=0,p2=0;
  5. while ( (c=getchar()) !=EOF ) {
  6. putchar(c);
  7. if (c == 'J' && p1 == '[' && p2 == 27) {
  8. putchar('\n');
  9. fflush(stdout);
  10. }
  11. p2 = p1; p1 = c;
  12. }
  13. return 0;
  14. }