Cod sursa(job #1197670)
Utilizator | Breahna David breahnadavid | Data | 13 iunie 2014 10:25:51 |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.61 kb |
#include<iostream>
#include<fstream>
#define maxn 20005
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char t[20002];
int lung,nr,j,ok;
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;
}