Cod sursa(job #810697)
Utilizator | Alexandru Valeanu AlexandruValeanu | Data | 10 noiembrie 2012 20:25:40 |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.44 kb |
#include <iostream>
#include <fstream>
#include <cstring>
using namespace std;
int main()
{
char s[1000],*p;
int nr=0,contor=0;
ifstream f("text.in");
ofstream g("text.out");
f.getline(s,1000);
char sub[]=",. -;:'\|][{}1234567890~`!@#$%^&*()_-+=/";
p=strtok(s,sub);
while(p)
{
nr+=strlen(p);
contor++;
p=strtok(NULL,sub);
}
g<<nr/contor;
return 0;
}