#include int main() { char buf[100]; while (fgets(buf, 100, stdin) != NULL) { fprintf(stdout, "%ld\n", ftell(stdin)); } if (fseek(stdin, 0, SEEK_SET) != 0) { perror("kann nicht suchen"); return 1; } while (fgets(buf, 100, stdin) != NULL) { fprintf(stdout, "%s", buf); } return 0; }