Pagini recente » Cod sursa (job #1398227) | Cod sursa (job #2544380) | Cod sursa (job #3215109) | Cod sursa (job #3265054) | Cod sursa (job #920405)
Cod sursa(job #920405)
#include <fstream>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int cuv,nrlit,temp;
char tempy;
int main()
{
//fout << (int)' ';
while(fin.get(tempy))
{
int baty = (int)tempy;
if((baty>=97&&baty<=122)||(baty>=65&&baty<=90))
{
nrlit++;
temp++;
}
if(baty==32)
{
if(temp>0)
cuv++;
temp=0;
}
}
if(temp>0)
cuv++;
fout << (int)nrlit/cuv;
return 0;
}