Pagini recente » Cod sursa (job #2176581) | Cod sursa (job #3145061) | Cod sursa (job #1694436) | Cod sursa (job #424269) | Cod sursa (job #1197673)
#include<iostream>
#include<fstream>
#include<string.h>
#define maxn 20005
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char t[20002];
int lung,nr,j,ok;
int main()
{
lung=nr=0;
while(!f.eof())
{
f.getline(t,20000);
for(int i=0;i<strlen(t);i++)
{
j=i;
ok=0;
while((t[i]>='a'&&t[i]<='z')||(t[i]>='A'&&t[i]<='Z')){i++;ok=1;}
if(ok){
lung+=i-j;
nr++;
}
}
}
g<<lung/nr;
g.close();
return 0;
}