Cod sursa(job #872084)

Utilizator tannous.marcTannous Marc tannous.marc Data 5 februarie 2013 19:15:23
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()
{
    char a;
    int k=0,y=0,x=0;
    while(fin.get(a))
    {
        if('a'<=a&&a<='z'||'A'<=a&&a<='Z')k++;
        else{
            if(k)y++;
            x+=k;
            k=0;
        }
    }
    fout<<x/y;
    fin.close();
    fout.close();
    return 0;
}