Pagini recente » Rating Craciun Calin (Calin15) | Cod sursa (job #2677046) | Rating Ghena GheRa (GheRa) | Profil OLORIN | Cod sursa (job #488079)
Cod sursa(job #488079)
#include<iostream.h>
#include<string.h>
#include<fstream.h>
#include<ctype.h>
ifstream f("text.in");
ofstream g("text.out");
main ()
{
char text[100000],*p,s[]=" .,;/\'1234567890-():",contl=0,contc=1;
int i;
f.get(text,100000);
p=strtok(text,s);
while(p)
{
contl=contl+strlen(p);
if(strlen(p)!=0) contc++;
p=strtok(NULL,s);
}
g<<contl/contc;
}