Cod sursa(job #1662378)

Utilizator DenisVieriuDenis Vieriu DenisVieriu Data 24 martie 2016 18:42:13
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.44 kb
#include <iostream>
#include <fstream>
using namespace std;
ofstream g("text.out");
int main()
{
    ifstream f("text.in");
    char s;
    int l=0,ok=0,c=0;
    while(f.get(s))
    {
        if(isalpha(s)&&s!='-')
        {
            if(ok==0)
            {
                c++;
                ok=1;
            }
            l++;
        }
        else
                ok=0;

    }
    g<<l/c;



    return 0;
}