Pagini recente » Cod sursa (job #2902525) | Cod sursa (job #1183032) | Cod sursa (job #835027) | Cod sursa (job #2386140) | 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;
}