Pagini recente » Cod sursa (job #2084697) | Cod sursa (job #333026) | Cod sursa (job #213192) | Cod sursa (job #778434) | Cod sursa (job #236881)
Cod sursa(job #236881)
#include <stdio.h>
#include <ctype.h>
int s=0, c;
bool sw;
char x;
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
x=fgetc(stdin);
while(!feof(stdin))
{
sw=1;
while (!isalpha(x)&&!feof(stdin))
x=fgetc(stdin);
while (isalpha(x)&&!feof(stdin))
{
sw=0;
s++;
x=fgetc(stdin);
}
if (sw==0)
c++;
}
printf("%d", s/c);
return 0;
}
/*#include <stdio.h>
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
char c;
int i=0,nrl=0;
c = fgetc(stdin);
int ok;
while(!feof(stdin))
{ok=0;
while(c>='a'&&c<='z' || c>='A'&&c<='Z')
{
nrl++;
c = fgetc(stdin);
ok=1;
}
if(ok==1)
i++;
c = fgetc(stdin);
}
printf("%ld",(nrl)/i);
return 0;
}
*/