Cod sursa(job #1942349)

Utilizator Alexandru_StoianStoian Sorin Alexandru Alexandru_Stoian Data 27 martie 2017 22:18:20
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.44 kb
#include <fstream>
#include <iostream>

using namespace std;

ifstream f ("text.in");
ofstream g ("text.out");

int k, ok, nr, d, i;
char x;
int main(){
    f.get( x );
    while( !f.eof() ){
        if ( ( x >= 65 && x <= 90 ) || ( x >= 97 && x <= 122 ) ){
            if( ok == 0 ) nr++;
            d++;
            ok = 1;
        }
        else{
            ok = 0;
        }
        f.get( x );
    }
    g << d / nr;
}