Cod sursa(job #2613695)

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

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

int main() {
    f.getline(s, 1000000);
    
    for ( i=0; s[i]; i++ )
        if ( isupper(s[i]) || islower(s[i]) )
            nrl++;
        else if ( isupper(s[i-1]) || islower(s[i-1]) )
            nrc++;

    g<<nrl/nrc;
    return 0;
}