Cod sursa(job #1138345)

Utilizator irimiecIrimie Catalin irimiec Data 9 martie 2014 21:30:10
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.62 kb
#include <fstream>
#include <cstring>

using namespace std;

ifstream f("text.in");
ofstream g("text.out");

int main() {
    char c[102400];
    long long st,sct;
    bool aux;
    st=sct=0;
    f>>c;
    while(!f.eof()) {
        long long s=0;
        aux=0;
        for(long long i=0;i<strlen(c);i++)
            if((c[i]>='a'&&c[i]<='z')||(c[i]>='A'&&c[i]<='Z')) {
                s++;
                if(!aux)
                    sct++;
                aux=1;
            } else
                aux=0;
        st+=s;
        //if(s)
        //    sct++;
        f>>c;
    }
    g<<st/sct;

}