Cod sursa(job #2613711)

Utilizator mihnea.anghelMihnea Anghel mihnea.anghel Data 10 mai 2020 15:39:24
Problema Text Scor 100
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.38 kb
#include <fstream>
#define f in
#define g out

using namespace std;
ifstream in ( "text.in" );
ofstream out( "text.out" );
char s;
int i, nrc, nrl, ok;

int main() {
    while ( f.get(s) ){
        if ( isalpha(s) ){
            nrl++;
            if ( !ok ){
                nrc++;
                ok = 1;
            }
        }
        else ok = 0;
    }
    g<<nrl/nrc;
    return 0;
}