Cod sursa(job #783372)
Utilizator | Aruxandei Cosmin Andrei cosminnica | Data | 2 septembrie 2012 17:20:14 |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.35 kb |
#include<iostream>
#include<fstream>
#include<math.h>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
long ch=0,t=0;
bool w=false;
char c;
int main()
{
while(f.eof())
{
while(f>>c)
if((c>='a'&&c<='z')||(c>='A'&&c<='Z'))
{
ch++;
w=true;
}
else
{
if(w)
t ++;
w=false;
}
}
if(w) t ++;
g<< ch/t;
return 0;
}