Cod sursa(job #874380)
Utilizator | Data | 8 februarie 2013 11:39:27 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.34 kb |
#include <fstream>
#include <string.h>
using namespace std;
int main()
{
int l=0,c=0;
char s[1001],*p;
ifstream f("text.in");
ofstream g("text.out");
f.get(s,10001);
p=strtok(s," 1234567890!~!@#$%^&*?><,./;'\:-_");
while (p!=NULL)
{ l=l+strlen(p);
c++;
p=strtok(NULL," 1234567890!~!@#$%^&*?><,./;'\:-_");
}
g<<l/c;
return 0;
}