Cod sursa(job #1197678)
Utilizator | Data | 13 iunie 2014 10:59:19 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.52 kb |
#include<iostream>
#include<fstream>
#include<string.h>
#define maxn 20005
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char t;
int lung,nr,j,ok;
int main()
{
lung=nr=0;
while(!f.eof())
{
f.get(t);
j=0;
while((t>='a'&&t<='z')||(t>='A'&&t<='Z')){f.get(t);j++;}
if(j>0){
lung+=j;
nr++;
}
}
g<<lung/nr;
g.close();
return 0;
}