Cod sursa(job #864994)
Utilizator | Data | 25 ianuarie 2013 21:59:20 | |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.35 kb |
using namespace std;
#include<fstream>
#include<string>
ifstream fin("text.in");
ofstream fout("text.out");
char text[1000], *p, sep[]=" ,-.?!1234567890";
int contor=0, nr=0;
int main()
{
fin.getline(text,1000);
p=strtok(text,sep);
while(p)
{
nr=nr+strlen(p);
contor++;
p=strtok(NULL,sep);
}
fout<<nr/contor;
return 0;
}