Cod sursa(job #234707)

Utilizator ssergiussSergiu-Ioan Ungur ssergiuss Data 21 decembrie 2008 20:06:24
Problema Text Scor 40
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.49 kb
#include<stdio.h>
#include<string.h>
#include<ctype.h>
char s[1000000];
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;}