Pagini recente » Cod sursa (job #546129) | Cod sursa (job #659842) | Cod sursa (job #1007843) | 10_oji1 | Cod sursa (job #915853)
Cod sursa(job #915853)
#include <iostream>
#include<fstream>
#include<string.h>
using namespace std;
int main()
{
ifstream f;
ofstream g;
f.open("text.in");
g.open("text.out");
char s[256], *p, e[]=" ,.!?;:(){}[]/\-""";
int i,k,n=0,c=0;
f.get(s,256);
i=0;
while(isalpha(s[i])==0)
i++;
strcpy(s,s+i);
p=strtok(s,e);
while(p)
{
c++;
n+=strlen(p);
p=strtok(NULL, e);
}
k=n/c;
g<<k;
return 0;
}