Cod sursa(job #1561745)
Utilizator | Data | 4 ianuarie 2016 14:58:04 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.39 kb |
#include <iostream>
#include <fstream>
#include <cstring>
using namespace std;
char s[100000000];
int nr,len;
int main()
{
ifstream fin("text.in");
fin.getline(s,100000000);
char *p=strtok(s," -.,<>?/\\;:\'\"!~");
while(p)
{
nr++;
len+=strlen(p);
p=strtok(0," -.,<>?/\\;:\'\"!~");
}
ofstream fout("text.out");
fout<<len/nr;
return 0;
}