Cod sursa(job #1045295)

Utilizator DGVanceaDragos Gabriel Vancea DGVancea Data 1 decembrie 2013 12:16:01
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.49 kb
#include <string.h>
#include <fstream>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");

int main()
{

    int i=0,lungt=0,nrcuv=0,ok=0;
    char x;
    while(fin.get(x))
    {

        if((x>='a'&& x<='z' )||(x>='A' && x<='Z'))
            {
                lungt++;
                ok=1;
            }else
        if(ok)
        {
            ok=0;
            nrcuv++;
        }

    }
   if(ok==1)nrcuv++;
    fout<<lungt/nrcuv;

    return 0;
}