Cod sursa(job #94335)

Utilizator igorPirnau Igor igor Data 22 octombrie 2007 18:01:28
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.39 kb
#include<fstream.h>
#include<stdio.h>

ofstream g("text.out");
         
char s;
int nrc1,nrc,nr;

int main()
{   freopen("text.in","r",stdin);
    while(!feof(stdin))
    {
    	scanf("%c",&s);
    	if((s>='A'&&s<='Z')||(s>='a'&&s<='z'))
		{	
			nrc1++;
			nrc++;
		}
			else
			 nrc1=0;
		if(nrc1==1) nr++;
	}
	
	g<<nrc/nr;
	g.close();
	return 0;
}