Cod sursa(job #991108)

Utilizator piticutzu15Covaciu Andrei piticutzu15 Data 29 august 2013 18:44:32
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.56 kb
#include<iostream>
#include<fstream>
#include<string.h>
int main()
    {
    std::ifstream f("text.in");
    std::ofstream g("text.out");
    char b;
    int s=0,n,i,x,ant=0;
    while( !f.eof() )
        {
            f.get(b);
            x=int(b);
            if(x>=65&&x<=90||x>=97&&x<=122)
            {
                if(ant==0)
                {
                    ant++;
                    s++;
                }
                n++;
            }
            else
                ant=0;


        }

    g<<n/s;
    return 0;
    }