Cod sursa(job #2196659)
Utilizator | Data | 19 aprilie 2018 23:23:40 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.42 kb |
#include <iostream>
#include <string.h>
#include <cstring>
#include <fstream>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
char s[1000],sep[]=".?!,;- ",*c;
int i,nr,l;
int main()
{
fin.get(s,1000);
c=strtok(s,sep);
while(c)
{
nr++;
for(i=0; i<strlen(c); i++)
{
l++;
}
c=strtok(NULL,sep);
}
fout<<l/nr;
}