Pagini recente » Cod sursa (job #1890490) | Cod sursa (job #266341) | Cod sursa (job #518700) | Cod sursa (job #2924756) | Cod sursa (job #741788)
Cod sursa(job #741788)
#include<fstream>
#include<iostream>
#include<string.h>
using namespace std;
ifstream f("o.in");
ofstream g("o.out");
int k=0,nr=0;
char *p,a[256]="",b[11]=" -:.;',?! ";
int main()
{
f.getline(a,256);
while(a[0]=='-'||a[0]=='"'||a[0]==' ')
strcpy(a,a+1);
p=strtok(a,b);
while(p)
{
nr+=strlen(p);
k++;
p=strtok(NULL,b);
}
if(k)
g<<(int)nr/k;
f.close();
g.close();
return 0;
}