Pagini recente » Cod sursa (job #981840) | Cod sursa (job #2330514) | Cod sursa (job #1305417) | Cod sursa (job #1016731) | Cod sursa (job #1574783)
#include <iostream>
#include <fstream>
#include <string.h>
using namespace std;
ifstream fin ("text.in");
ofstream fout ("text.out");
char a;
int lungime=0, nr=0,flag=0;
int main()
{
while(fin.get(a))
{
if((a>='a' && a<='z') || (a>='A' && a<='Z'))
{lungime++;flag=1;}
else
if(flag==1)
{nr++;flag=0;}
}
if (nr==0)
{fout<<0;return 0;}
fout<<lungime/nr;
return 0;
}