Pagini recente » Cod sursa (job #1053463) | Cod sursa (job #211370)
Cod sursa(job #211370)
#include <stdio.h>
#include <iostream>
using namespace std;
int citire()
{
char buffer;
bool k=false;
int n,cuv=0,lungime=0;
freopen("text.in","r",stdin);
while (!feof(stdin))
{
scanf("%c",&buffer);
n=(int)buffer;
if ((n>=65 && n<=90) || (n>=97 && n<=122))
{
lungime++;
}
if (!k && n!=32)
{
cuv++;
k=true;
}
if (n==32)
k=false;
}
return lungime/cuv;
}
int main()
{
freopen ("text.out","w",stdout);
printf ("%d",citire());
fclose (stdout);
return 0;
}