Cod sursa(job #372659)
Utilizator | Data | 11 decembrie 2009 09:44:20 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.24 kb |
#include <fstream.h>
#include<string.h>
main()
{char a[50000],*p, s[]=" .,-!?";
int b=0,k=0;
ifstream f("text.in");
ofstream g("text.out");
f.get(a,500);
p=strtok(a,s);
while(p)
{k++;
b=b+strlen(p);
p=strtok(NULL,s);
}
g<<b/k;
}