Cod sursa(job #866173)

Utilizator rares.opariucRares Opariuc rares.opariuc Data 27 ianuarie 2013 17:11:32
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.38 kb
#include <fstream>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int main()
{
    int l=0,t=0,c=0;
    char a;
    while(fin.get(a))
    {
        if(('a'<=a&&a<='z')||('A'<=a&&a<='Z'))l++;
        else{
            if(l)c++;
            t+=l;
            l=0;
        }
    }
    fout<<t/c;
    fin.close();
    fout.close();
    return 0;
}