Pagini recente » Cod sursa (job #2493334) | Cod sursa (job #422659) | Cod sursa (job #1835483) | Cod sursa (job #228175) | Cod sursa (job #2203497)
#include <bits/stdc++.h>
using namespace std;
char c[1200];
char sep[]=". , - ; ! ?";
int n,lungime,cuvinte;
ifstream fin("text.in");
ofstream fout("text.out");
int main()
{
fin.get(c,1200);
char *p=strtok(c,sep);
// cout<<c;
while(p!=NULL)
{
// cout<<p<<endl;
cuvinte++;
n=strlen(p);
lungime=lungime+n;
p=strtok(NULL,sep);
}
// fout<<cuvinte<<" "<<lungime<<"\n";
fout<<lungime/cuvinte;
return 0;
}