Cod sursa(job #969830)
Utilizator | Data | 5 iulie 2013 14:19:28 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.39 kb |
#include <iostream>
#include<fstream>
using namespace std;
int main()
{
ifstream f("text.in");
ofstream g("text.out");
char s;
int l=0,c=0,t=0;
while(f.get(s))
{ if((s>='a' && s<='z')||(s>='A' && s<='Z'))
l++;
else
{
if(l) c++;
t+=l;
l=0;
}
}
g<<t/c;
return 0;
}