Cod sursa(job #829955)

Utilizator bondoralexandru bondor bondor Data 6 decembrie 2012 09:00:34
Problema Text Scor 30
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.44 kb
#include<stdio.h>
#include<string.h>
using namespace std;
int main(){
    int cuv,sum;
    char s[60000],*p;
    freopen("text.in","r",stdin);
    freopen("text.out","w",stdout);
    gets(s);
    p=strtok(s," ,!?.-;");
    cuv=1;
    sum=strlen(p);
    while(p!=NULL){
        p=strtok(NULL," ,!?.-;");
        if(p!=NULL){
            cuv++;
            sum+=strlen(p);
        }
    }
    printf("%d",sum/cuv);
    return 0;
}