Cod sursa(job #610100)
Utilizator | Data | 24 august 2011 21:26:51 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.35 kb |
#include<fstream>
#include<string>
using namespace std;
int main()
{
ifstream f("text.in");
ofstream g("text.out");
char sir[256];
char semne[]=" ,?-!.,;:";
int l=0,c=0;
char *p;
f.get(sir,255);
f.close();
p=strtok(sir,semne);
while(p)
{
c++;
l=l+strlen(p);
p=strtok(NULL,semne);
}
g<<int(l/c);
g.close();
return 0;
}