Cod sursa(job #234708)
Utilizator | Sergiu-Ioan Ungur ssergiuss | Data | 21 decembrie 2008 20:08:33 |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.49 kb |
#include<stdio.h>
#include<string.h>
#include<ctype.h>
char s[1000000000];
void solve(){
int i,n,x=0,k=0;
gets(s);
n=strlen(s);
for(i=0; i<n; )
if(isalpha(s[i])){
++k;
while(isalpha(s[i])){
++i;
++x;}}
else
while(!isalpha(s[i]))
++i;
printf("%d",x/k);}
int main(){
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
solve();
return 0;}