Cod sursa(job #947749)
Utilizator | Data | 8 mai 2013 12:42:05 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.3 kb |
using namespace std;
#include<fstream>
#include<cstring>
ifstream fin("text.in");
ofstream fout("text.out");
int main()
{
int i=0,s=0;
char x[200],sep[]=" :*()[]{}/\ .;!?,-";
char *p;
fin.get(x,200);
p=strtok(x,sep);
while(p)
{
i++;
s=s+strlen(p);
p=strtok(NULL,sep);
}
fout<<s/i;
}