Cod sursa(job #1099408)

Utilizator ovidel95Ovidiu ovidel95 Data 5 februarie 2014 20:32:54
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.6 kb
#include<cstring>
#include<cstdio>
using namespace std;

int main()
{
    freopen("text.in","r",stdin);
    freopen("text.out","w",stdout);
    char s;
    int nrlit=0,nrcuv=0,k;
    while(scanf("%c",&s)!=EOF)
    {
        if((s>='a'&&s<='z')||(s>='A'&&s<='Z'))
            {
                nrlit++;
		if(k==0)
            	{
                	nrcuv++;
               		k=1;
            	}
            }
        else
            k=0;

    }
    if(nrcuv==0)
        printf("0");
    else
        printf("%d",nrlit/nrcuv);
    fclose(stdin);
    fclose(stdout);
    return 0;
}