Cod sursa(job #874372)
Utilizator | Data | 8 februarie 2013 11:34:16 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.37 kb |
#include <fstream>
#include <string.h>
using namespace std;
int main()
{
char s[1001],*p,d[]="-!? ,.\';123456789";
int c1=0,c2=0;
ifstream f("text.in");
ofstream g("text.out");
f.get(s,1001);
p=strtok(s,d);
while(p!=NULL)
{
c1=c1+strlen(p);
c2++;
p=strtok(NULL,d);
}
g<<c1/c2;
return 0;
}