Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as text by kvas ( 17 years ago )
#include <stdio.h>

#define IN 1
#define OUT 0
main()
{
	int c, nl, nw, nc, state;
	
	state=OUT;
	nl=nw=nc=0;
	while ((c=getchar()!=EOF))
		{
			++nc;
			if (c=='n')
				++nl;
				if(c==" " || c=='
' || c=='	')
				state=OUT;
			else if (state == OUT) {
				state = IN;
				++nw;
			}			
		}
		printf("%d %d %d
", nl, nw, nc);
}

 

Revise this Paste

Your Name: Code Language: