Cod sursa(job #386445)

Utilizator ghitzZzaGheorghita Hurmuz ghitzZza Data 24 ianuarie 2010 20:24:59
Problema Text Scor 10
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.39 kb
#include <fstream>
using namespace std;

int main()
{
    ifstream g("text.in");
    ofstream f("text.out");
    char ch;
    int len=0,cuv=0,k=0,m;
    while(g>>ch)
    {
        if((ch>=65 && ch<=90)||(ch>=97 && ch<=122))
        {
            len++;
            if(k==0) cuv++;
            k=1;
        }
        else k=0;
    }
    m=len/cuv;
    f<<m;
    return 0;
}