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