Pagini recente » Cod sursa (job #3192744) | Cod sursa (job #2981124) | Cod sursa (job #3267992) | Cod sursa (job #2127112) | Cod sursa (job #1415325)
#include <iostream>
#include <fstream>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
char last,now;
int nrCuvinte,nrLitere;
int main()
{
fin.get(last);
if( (last>='a' && last<='z') || (last>='A' && last<='Z') )
nrLitere++;
while( fin.get(now) )
{
if( ( now>='a' && now<='z') || (now>='A' && now<='Z') )
{
nrLitere++;
}
else
if((last>='a' && last<='z') || (last>='A' && last<='Z'))
nrCuvinte++;
last=now;
}
if(nrCuvinte)
fout<<nrLitere/nrCuvinte;
return 0;
}