Cod sursa(job #1779642)
Utilizator | Data | 15 octombrie 2016 15:13:36 | |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.5 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream in("text.in");
ofstream out("text.out");
long long sum,k,j;
char c;
int main()
{
while(c!=EOF)
{
in>>c;
if(isalpha(c))++j;
else
{
if(j!=0)
{
sum+=j;
++k;
}
j=0;
}
}
if(j!=0)
{
k++;
sum+=j;
}
if(k!=0)out<<j/k;
else out<<"0";
return 0;
}