Cod sursa(job #1429801)

Utilizator cristibogdanPatrascu Cristian cristibogdan Data 7 mai 2015 10:03:09
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.44 kb
#include <fstream>
#include <string.h>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char ch;
int k,nrc,nrl,n;
int main()
{
    while(f.get(ch)&&ch!=EOF)
    {
        if((ch>='a'&&ch<='z')||(ch>='A'&&ch<='Z'))
        {
            nrl++;
            if(k==0)
            {
                k=1;
                nrc++;
            }
        }
        else
            k=0;}
    g<<nrl/nrc;
    return 0;
}