Cod sursa(job #1942334)

Utilizator Alexandru_StoianStoian Sorin Alexandru Alexandru_Stoian Data 27 martie 2017 22:08:42
Problema Text Scor 20
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.46 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( x != '!' && x != '.' && x != '?' ){
        f.get( x );
        if ( ( x >= 65 && x <= 90 ) || ( x >= 97 && x <= 122 ) ){
            if( ok == 0 ) nr++;
            d++;
            ok = 1;
        }
        else{
            ok = 0;
        }
    }
    g << d / nr;
}