/*			NTWS
 *	No Trailing White Spaces
 *
 * Takes from stdin, writes to stdout without trailing while spaces
 *
 */

#include <stdio.h>

main()
{
	char inbuf[255];
	char *bufp;
	long cnt;

	cnt=0L;
	while (gets(inbuf)) {
		bufp=inbuf+strlen(inbuf)-1;
		while(index("\n\r\t ",(*bufp))) {
			*(bufp--) = 0;
			cnt+=1;
		}
		puts(inbuf);
	}
	fprintf(stderr,"\nRemoved %ld trailing white space%c\n"\
	,cnt,(cnt==1L)?'':'s');
}
