Cod sursa(job #1014805)
Utilizator | Data | 23 octombrie 2013 13:35:21 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.43 kb |
#include<fstream>
using namespace std;
int a,b,nr;
char c;
int main()
{
ifstream fin("text.in");
ofstream fout("text.out");
while(fin.get(c))
{
if(c>='a' && c<='z' || c>='A' && c<='Z')
a++;
else
if(a!=0)
{
nr+=a;
b++;
a=0;
}
}
fin.close();
fout<<nr/b<<'\n';
fout.close();
return 0;
}