Cod sursa(job #1327791)
Utilizator | Data | 27 ianuarie 2015 09:17:47 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.39 kb |
#include <iostream>
#include <fstream>
#include <string.h>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char s[100000];
int sm=0,cuv=0;
int main()
{
f.getline(s,100000);
char* p;
p=strtok(s," .,/;-=+[]{}");
while(p){
sm+=strlen(p);
++cuv;
p=strtok(0," .,/;-=+\|[]{}");
}
g<<sm/cuv;
return 0;
}