Cod sursa(job #860853)
Utilizator | Data | 20 ianuarie 2013 19:40:57 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.39 kb |
#include<fstream>
using namespace std;
char s;
long i,lung=0,k,n;
int main()
{
ifstream f("text.in");
ofstream g("text.out");
while(f.get(s))
{
if(('a'<=s && s<='z')||('A'<=s && s<='Z'))
lung++;
else if(lung)
{
n=n+lung;
k++;
lung=0;
}
}
g<<n/k;
}