Cod sursa(job #785201)

Utilizator MtkMarianHagrSnaf MtkMarian Data 8 septembrie 2012 08:19:41
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.61 kb
#include<fstream>
#include<iostream>
using namespace std;

int main()
{
	freopen("text.in","r",stdin);
	freopen("text.out","w",stdout);
	
    long long l=0;
	int cuv=0;
	bool k=0;
	char c;
	scanf("%c",&c);
	if((c<='z'&&c>='a')||(c<='Z'&&c>='A'))
	{
		k=l=1;
	}
	while( !feof(stdin))
	{
		scanf("%c",&c);
		 if((c<='z'&&c>='a')||(c<='Z'&&c>='A'))
							
				if(k!=1) 
				{
					++l;	
					k=1;
				}
					else 
					{
						++l;
					}
			
			else	
				if(k==1)
				{
					++cuv;
					k=0;
				}
			
		    
		
	}
	//printf("%d",cuv);
	printf("%d",l/cuv);	
		
	return 0 ;
	
}