Cod sursa(job #1308749)

Utilizator nacrocRadu C nacroc Data 4 ianuarie 2015 17:05:44
Problema Text Scor 30
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.4 kb
#include<stdio.h>
#include<string.h>
#include<ctype.h>
#define NMAX 1<<30

using namespace std;

char s[NMAX],*p;

int main(){
    freopen("text.in","r",stdin);
    freopen("text.out","w",stdout);
    int cuv=1;
    gets(s);
    int n=strlen(s);
    for(int i=0;i<strlen(s);++i){
        if(s[i]==' ') ++cuv;
        if(!isalpha(s[i])) --n;
    }
    printf("%d\n",n/cuv);
    return 0;
}