Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- /* le: output every line of input prefixed with "le" */
- int main()
- {
- int c;
- int d = 0;
- printf("le ");
- while ((c = getchar()) != EOF) {
- putchar(c);
- if (c == '\n' && (d = getchar()) != EOF)
- printf("le ");
- if (d) {
- ungetc(d, stdin);
- d = 0;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement