Cod sursa(job #672314)

Utilizator AlexComAlexandru Coman AlexCom Data 1 februarie 2012 20:52:56
Problema Text Scor 60
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.47 kb
#include <iostream>
#include <string.h>
#include <fstream>

using namespace std;

int main()
{
    char c;
    long litere=0,cuvinte=0,ok=1;
    ifstream f("text.in");
    c=f.get();
    while(c!=EOF)
    {
        if(c>='a' && c<='z' || c<='A' && c>='Z')
        {
            litere++;
            ok=0;
        }
        else ok++;

        if(ok==1)
        cuvinte++;

        c=f.get();

    }
    ofstream g("text.out");
    g<<litere/cuvinte;



    return 0;
}