Pagini recente » Cod sursa (job #1412215) | Cod sursa (job #3241410) | Cod sursa (job #990441) | Cod sursa (job #3234644) | Cod sursa (job #914537)
Cod sursa(job #914537)
#include <fstream>
#include <cstring>
using namespace std;
#define MAXN 1100000
char t[MAXN];
int main()
{
char *p, sir[] = " ,.-![]\\/^_`1234567890";
unsigned int i = 0, suma = 0;
ifstream fin("text.in");
ofstream fout("text.out");
fin.getline(t,MAXN);
fin.close();
p = strtok(t, sir);
while(p){
suma += strlen(p);
p = strtok(NULL, sir);
i++;
}
if(i) fout << suma/i << "\n";
fout.close();
return 0;
}