Cod sursa(job #1673178)

Utilizator AlexVulpoiuAlexandru Vulpoiu AlexVulpoiu Data 3 aprilie 2016 15:22:30
Problema Text Scor 20
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.38 kb
#include <cstdio>
using namespace std;
int l,nc;
char c;
int main()
{
    freopen("text.in","r",stdin);
    freopen("text.out","w",stdout);
    nc=2;
    while(scanf("%c",&c) && c!=10)
        if((c>='a' && c<='z') || (c>='A' && c<='Z'))
            l++;
        else
            if(c==32 && l!=0)
                nc++;
    l/=nc;
    printf("%d",l);
    return 0;
}