

#include <stdio.h>

/* This program takes a file and causes two newlines
in a row to become one
and takes more than two and makes them two.
*/

main(argc, argv)
int argc;
char *argv[];
{
	int flag, c;
	flag = 0;
	while ((c = getchar()) != EOF)
	{
		if (c == '\n')  flag++;
		else 
		 {if (flag == 1) {flag = 0; putchar('\n'); putchar(c);}
		  else if (flag == 2) {flag = 0; putchar('\n'); putchar(c);}
		  else if (flag > 2) {flag = 0; putchar('\n'); putchar('\n');
					putchar(c);}
		  else putchar(c);
		}
	}
}
