Pagini recente » Cod sursa (job #862006) | Cod sursa (job #642207) | Cod sursa (job #854974) | Borderou de evaluare (job #2511009) | Cod sursa (job #783372)
Cod sursa(job #783372)
#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;
}