Pagini recente » Cod sursa (job #2637419) | Cod sursa (job #1493535) | Cod sursa (job #2199258) | Cod sursa (job #1681213) | Cod sursa (job #549352)
Cod sursa(job #549352)
#include <iostream>
#include<fstream>
#include<string.h>
using namespace std;
fstream f("text.in",ios::in);
fstream g("text.out",ios::out);
char a[20000000],*p;
long long n,nr;
int main()
{
while(!f.eof())
{f>>a;
p=strtok(a," .,?;:'!@#$%^&*_+=-<>/*(){}");
if(!f.eof())
while(p)
{nr++;
n=n+strlen(p);
p=strtok(NULL," .,?;:'!@#$%^&*_+=-<>/*(){}");}}
g<<n/nr;
return 0;
}