Pagini recente » Cod sursa (job #625436) | Cod sursa (job #1409862) | Cod sursa (job #2183467) | Cod sursa (job #1908837) | Cod sursa (job #1435349)
# include <fstream>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int n,nr,cuv;
char x,y;
int litera(char a)
{
if((a>=65 && a<=90) || (a>=97 && a<=122) )
return 1;
return 0;
}
int main()
{
nr = 0;
cuv = 0;
x = 0;
while( f >> noskipws >>y )
{
if( litera(y) == 1 )
nr ++;
if(x != 0)
if( litera(y) == 0 )
if( litera(x) == 1)
cuv ++;
x = y;
}
g << nr / cuv;
return 0;
}