Cod sursa(job #2328460)

Utilizator fratele_meriusEnache-Stratulat Marius fratele_merius Data 25 ianuarie 2019 19:35:47
Problema Text Scor 40
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.48 kb
#include <fstream>
#include <cstring>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char text[200];
int main()
{
    int n=0,l=0,i;
    f.get(text, 200);
    for(i=0; i<strlen(text);)
        if((text[i]>='a' and text[i]<='z') or (text[i]>='A' and text[i]<='Z')){
            n++;
            while((text[i]>='a' and text[i]<='z') or (text[i]>='A' and text[i]<='Z'))
                l++,i++;
        }
        else i++;
    g<<l/n;
    return 0;
}