Cod sursa(job #2427395)
Utilizator | Data | 31 mai 2019 18:51:38 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.49 kb |
#include <fstream>
#include <string.h>
using namespace std;
ifstream cin("text.in");
ofstream cout("text.out");
int l, cnt;
char caractere[]=" ,.!?-+*/123456789=~@#$%^&*()_";
int main()
{
char s[1005], *p;
while(cin.get(s, 1005))
{
p=strtok(s, caractere);
while(p!=NULL)
{
l+=strlen(p);
cnt++;
p=strtok(NULL, caractere);
}
}
cout << l/cnt;
}