Cod sursa(job #904568)

Utilizator gabriel93Robu Gabriel gabriel93 Data 4 martie 2013 16:32:18
Problema Text Scor 20
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.6 kb
#include<stdio.h>
using namespace std;
int nr,l;

void rezolv()
{
    char c;
    int ok=0;
    do
    {
        scanf("%c",&c);
        if(('a'<=c && c<='z') || ('A'<=c && c<='Z'))
        {
            ++l;
            ok=1;
        }
        else
            if(ok==1)
            {
                ++nr;
                ok=0;
            }
    }while(c!='\n');
    if(nr==0)
        nr=1;
    printf("%d",l/(nr+1));
}

int main()
{
    freopen("text.in","r",stdin);
    freopen("text.out","w",stdout);
    rezolv();
    fclose(stdin);
    fclose(stdout);
    return 0;
}