Cod sursa(job #2200472)
Utilizator | Data | 1 mai 2018 15:52:57 | |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.34 kb |
#include <iostream>
#include <fstream>
#include <cctype>
#include <cstring>
using namespace std;
ifstream fin("text.in");
ofstream fout ("text.out");
int main()
{
char s[4000], *p;
int c=0,l=0;
cin.getline(s,4000);
p = strtok(s," ,-;?:!");
while(p!=NULL)
{
l=l+strlen(p);
c++;
p=strtok(NULL," ,-;?:!");
}
cout<<l/c;
return 0;
}