Cod sursa(job #1187137)

Utilizator MihailPJack ONeill MihailP Data 17 mai 2014 18:27:22
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.52 kb
#include<fstream>
#include<string.h>
using namespace std;
int main()
{
    fstream f,g;
    f.open("text.in",ios::in);
    g.open("text.out",ios::out);
    char s[1000000],*p,c;
    int i,nr=0,nr1=0,ok=0;
    c=f.get();
    while(!f.eof())
    {
        if((c>='a' && c<='z') || (c>='A' && c<='Z'))
        {
            nr++;
            if(ok==0)
            {
                nr1++;
                ok=1;
            }
        }
        else
            ok=0;
        c=f.get();

    }
    g<<nr/nr1;
}