Cod sursa(job #1212783)

Utilizator pufstarDragos Gheorghiu pufstar Data 25 iulie 2014 22:25:44
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.37 kb
#include<fstream>
using namespace std;
ifstream f("text.in"); ofstream g("text.out");
int nl, nc, k=1;
char c;
int main()
{
    while(c!=EOF)
    {
        c=f.get();
        if(c>='A' && c<='Z' || c>='a' && c<='z')
        {
            nl++;
            if(k==1) nc++; k=0;
        }
        else k=1;
    }
    g<<nl/nc;
    g.close();
    return 0;
}