Cod sursa(job #2074189)

Utilizator Eusebiu_VolostiucVolostiuc Eusebiu Eusebiu_Volostiuc Data 24 noiembrie 2017 10:31:04
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.37 kb
#include <bits/stdc++.h>

using namespace std;
ifstream f("text.in");
ofstream g("text.out");
string c;
int main()
{   int n,i,ok,p=0,k=0;
    while(f>>c)
    {
        ok=0;
        n=c.size();
        for(i=0;i<=n;i++)
            if(isalpha(c[i]))
            p++,ok=1;
        else
        if(ok==1)
            k++,ok=0;
    }
    g<<p/k;
    return 0;
}