Pagini recente » Cod sursa (job #2815422) | Cod sursa (job #2585784) | Cod sursa (job #2168943) | Cod sursa (job #2875632) | Cod sursa (job #560878)
Cod sursa(job #560878)
#include<iostream>
#include<fstream>
#include<cctype>
using namespace std;
int main()
{
float 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<<(int)(t/w);
Out.close();
return 0;
}