Cod sursa(job #1722918)

Utilizator andreigeorge08Sandu Ciorba andreigeorge08 Data 29 iunie 2016 13:11:10
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.49 kb
#include <fstream>

using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
char c;
void Rezolvare()
{
    int contor=0,nrc=0,aux=0;
    while(fin.get(c))
    {
        if(('a'<=c and c<='z')|| ('A'<=c and c<='Z')){
            contor++;
            aux=1;
        }
        else if(aux==1){
            nrc++;
            aux=0;
        }
    }
    fout<<contor/nrc<<"\n";
}
int main()
{
    Rezolvare();
    fin.close();
    fout.close();
    return 0;
}