Cod sursa(job #1087597)
Utilizator | Data | 19 ianuarie 2014 17:02:30 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.4 kb |
#include <cstdio>
#include <cstring>
#define MAX 1005000
using namespace std;
int nr,tot;
char sir[MAX],*p,sep[]=",. !?'-;";
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
gets(sir);
p=strtok(sir,sep);
while(p!=NULL)
{
nr++;
tot+=strlen(p);
p=strtok(NULL,sep);
}
printf("%d",tot/nr);
return 0;
}