Cod sursa(job #1146190)
Utilizator | Data | 18 martie 2014 19:50:58 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.54 kb |
#include<fstream>
#include<cstring>
using namespace std;
ifstream in("text.in");
ofstream out("text.out");
char s[1084000];
int main ()
{
int suma=0,nr=0,i;
while(in.getline(s,1000))
{
for(i=0;i<strlen(s);i++)
{
if(s[i]>='a' && s[i]<='z')
{
nr++;
while(s[i]>='a' && s[i]<='z')
{
suma++;
i++;
}
}
}
}
out<<suma/nr<<'\n';
return 0;
}