Cod sursa(job #632278)
Utilizator | Data | 10 noiembrie 2011 19:27:49 | |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.3 kb |
#include<fstream>
#include<string>
using namespace std;
ifstream f("cifra.in");
ofstream g("cifra.out");
int main ()
{
int s=0,i=0;
char a[1001],x[]=" .,/!?`;:";
f.get(a,1000);
char *p;
p=strtok(a,x);
while(p)
{
i++;
s=s+strlen(p);
p=strtok(NULL,x);
}
g<<s/i;
return 0;
}