Cod sursa(job #2274134)
Utilizator | Data | 1 noiembrie 2018 14:08:11 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.44 kb |
#include <fstream>
#include <cstring>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char s;
int i,n,nrcif,cuv;
int main()
{
while(f.get(s))
{
if(isalpha(s))
{
nrcif++;
n++;
}
else if(nrcif>0)
{
nrcif=0;
cuv++;
}
}
if(nrcif>0)
{
cuv++;
}
g<<n/cuv<<'\n';
return 0;
}