Pagini recente » Cod sursa (job #2399091) | Cod sursa (job #419634) | Cod sursa (job #843508) | Cod sursa (job #1666097) | Cod sursa (job #34093)
Cod sursa(job #34093)
#include <fstream.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char text[100000];
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)|| (text[i] > 47 && text[i]<57)){
len++;
}
else {
len_tot=len_tot+len;
if(len!=0)
nr_cuv++;
len=0;
}
}
if(nr_cuv==0) nr_cuv=1;
printf("%ld",len_tot/nr_cuv);
return 0;
}