Cod sursa(job #735670)

Utilizator TrixerAdrian Dinu Trixer Data 16 aprilie 2012 23:10:59
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.49 kb
#include <iostream>
#include <fstream>
#include <string.h>

using namespace std;

int main()
{
int l=0,c=0,ok=0;
char t;
ifstream f;
ofstream g;

    f.open("text.in");
    while (f.get(t)) {if ((t-0>=65&&t-0<=90)||(t-0>=97&&t-0<=122))
                        {l++;
                         if (ok==0) {c++; ok=1;}
                        }
                      else ok=0;
                     }
    f.close();

    g.open("text.out");
    g<<l/c;
    g.close();

return 0;
}