Cod sursa(job #1087375)
Utilizator | Data | 19 ianuarie 2014 12:37:19 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.32 kb |
#include <fstream>
#include <cstring>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char v[1001],*p;
int l,nrcuvinte;
int main()
{
f.get(v,1001);
p=strtok(v," .,-!?");
while(p)
{nrcuvinte++;l+=strlen(p);
p=strtok(NULL," .,-!?");
}
g<<l/nrcuvinte;
return 0;
}