Cod sursa(job #1483588)

Utilizator LucianTLucian Trepteanu LucianT Data 9 septembrie 2015 16:39:38
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.6 kb
#include <fstream>
#include <cstdio>
#include <cstring>
using namespace std;
int lun,cuv;
char c;
bool ok;
int main()
{
    freopen("text.in","r",stdin);
    freopen("text.out","w",stdout);
    //ifstream f("text.in");
    //ofstream g("text.out");
    //parsare
    while(scanf("%c", &c) != EOF)
    {
        if((c<='z' && c>='a')||(c<='Z' && c>='A'))
        {
            //numar de litere
            lun++;
            //prima litera din cuvant
            if(ok==false) cuv++;
            ok=true;
        }
        else ok=false;
    }
    printf("%d",lun/cuv);
    return 0;
}