Cod sursa(job #173645)
| Utilizator | Data | 7 aprilie 2008 22:00:01 | |
|---|---|---|---|
| Problema | Text | Scor | 30 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.52 kb |
#include<stdio.h>
#include<string.h>
int main(){
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
char s[1048577];
int nrc=0,nrcuv=0,i,nrtot=0,ok=1;
gets(s);
nrc=strlen(s);
for(i=0;i<nrc;i++){
ok=1;
if(s[i]>='a' && s[i]<='z' || s[i]>='A' && s[i]<='Z'){
nrtot++;
ok=0;
}
if(s[i]==' ')
if(ok==1)
nrcuv++;
}
if(s[nrc]==' ')
nrcuv--;
//printf("%d %d\n",nrtot,nrcuv+1);
printf("%d\n",nrtot/(nrcuv+1));
/*printf("%d",nrc);
printf("%c",s[nrc]);*/
return 0;
}
