Cod sursa(job #1527950)

Utilizator raducostacheRadu Costache raducostache Data 18 noiembrie 2015 21:28:47
Problema Text Scor 10
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.44 kb
#include <fstream>
#include <cctype>
#include <cstring>

using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
char s[10000001];
long long n,i,l,c;
int main()
{
    fin.get(s,'\n');
    n=strlen(s);
    for(i=0;i<n;++i)
    {
        if(isalpha(s[i]))
        {
            c++;
            while(isalpha(s[i]))
            {
                ++i;
                ++l;
            }
        }
    }
    fout<<l/c;
    return 0;
}