Pagini recente » Cod sursa (job #833307) | Cod sursa (job #2728554) | Cod sursa (job #769947) | Cod sursa (job #61829) | Cod sursa (job #560874)
Cod sursa(job #560874)
#include<iostream>
#include<fstream>
#include<cctype>
using namespace std;
int main()
{
unsigned int t=0,w=0;
char c,b;
ifstream In("text.in");
In.get(c);
if( isalpha(b) )
{
t++;
w++;
}
while(In.get(c))
{
if( isalpha(c) )
{
t++;
if( !isalpha(b) ) w++;
}
b=c;
}
In.close();
ofstream Out("text.out");
Out<<t/w;
Out.close();
return 0;
}