Cod sursa(job #2076093)
Utilizator | Data | 26 noiembrie 2017 10:14:40 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.42 kb |
#include<iostream>
#include<fstream>
#include<string.h>
using namespace std;
int main()
{
ifstream f("text.in");
ofstream g("text.out");
char s[1000000];
int j=0,su=0;
while(f.get(s,10000))
{char *p=strtok(s," ,!-");
while(p!=NULL)
{
su=su+strlen(p);
j++;
p=strtok(NULL," ,!-");
}
}
g<<(int)su/j;
return 0;
}