Pagini recente » Cod sursa (job #1120229) | Cod sursa (job #1725246) | Cod sursa (job #2467488) | Cod sursa (job #573166) | Cod sursa (job #33876)
Cod sursa(job #33876)
#include <fstream.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char text[10000000];
int main(){
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
unsigned long int len=0,len_tot=0,nr_cuv=0;
gets(text);
for(int i=0;i<=strlen(text);i++){
if((text[i] > 96 && text[i]<123) || (text[i] > 64 && text[i] < 90)){
len++;
}
else {
len_tot=len_tot+len;
if(len!=0)
nr_cuv++;
len=0;
}
}
if(nr_cuv==0) nr_cuv=1;
printf("%d",len_tot/nr_cuv);
return 0;
}