Cod sursa(job #2103766)

Utilizator AlexandruPaulSirbu Alex AlexandruPaul Data 10 ianuarie 2018 19:42:33
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.46 kb
#include <iostream>
#include <fstream>
///97 122
///65 90
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
string s;
int nr,tot,len,nr1;
bool ok=0;
char x;
int main()
{
    while (fin.get(x))
    {
        if ((x>='a' && x<='z')||(x>='A' && x<='Z'))
        {
            nr++;
            if (ok==0)
                ok=1,tot++;
        }
        else
            ok=0;
    }
    fout<<nr/tot<<"\n";
    return 0;
}