Cod sursa(job #1577621)
Utilizator | Data | 23 ianuarie 2016 16:55:09 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.39 kb |
#include <iostream>
#include <string.h>
#include <fstream>
using namespace std;
int main()
{
int k=0,s=0;
char n[256],*p,i, sep[]=" .,:;'!-?0123456789";
ifstream f ("text.in");
ofstream g ("text.out");
f.getline(n,256);
p=strtok(n,sep);
while(p)
{
k++;
s=s+strlen(p);
p=strtok(NULL, sep);
}
g<<s/k;
g.close();
}