Cod sursa(job #1896018)

Utilizator GeorgeCalinPetruta George-Calin GeorgeCalin Data 28 februarie 2017 13:20:57
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.56 kb
#include <fstream>
#include <cstdio>
#define f stdin
#define g stdout
using namespace std;

int main()
{
    freopen("text.in","r",f);
    freopen("text.out","w",g);
    char c,p;
    int k=0;
    int nr_cuv=0;
    while(!feof(f))
    {
        scanf("%c",&c);
        if((c>='a'&&c<='z')||(c>='A'&&c<='Z'))
        {
            k++;
        }
        else
        {
            if((p>='a'&&p<='z')||(p>='A'&&p<='Z'))
            {
                nr_cuv++;
            }
        }
        p=c;
    }
    printf("%d",k/nr_cuv);
    return 0;
}