Pagini recente » Cod sursa (job #3187734) | Cod sursa (job #2642381) | mafia_de_pe_infoarena | Cod sursa (job #1045108) | Cod sursa (job #264172)
Cod sursa(job #264172)
#include<fstream.h>
#include<string.h>
#include<ctype.h>
char s[250],*p;
int i,k1,k2;
int main()
{
ifstream f("text.in");
f.get(s,250);
f.close();
for(i=0;i<strlen(s);i++)
if(!isalpha(s[i]))
s[i]=' ';
for(p=strtok(s," ");p;p=strtok(NULL," "))
{
k1+=strlen(p);
k2++;
}
ofstream fout("text.out");
fout<<k1/k2;
fout.close();
return 0;
}