Pagini recente » Cod sursa (job #625949) | grind_baraje_liceu | Monitorul de evaluare | Cod sursa (job #180892) | Cod sursa (job #798924)
Cod sursa(job #798924)
#include<cstdio>
using namespace std;
char x;
int ok,i,nr,p;
bool litera(char x)
{
if ((('a'<=x) && (x<='z')) || (('A'<=x) && (x<='Z')))
return true;
else return false;
}
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
ok=0;
while (scanf("%c",&x)!=EOF)
{
if (litera(x))
{
if (ok==0)
{
nr++;
ok=1;
}
p++;
}
else ok=0;
}
printf("%d",p/nr);
}