Cod sursa(job #2427396)
| Utilizator | Data | 31 mai 2019 18:53:22 | |
|---|---|---|---|
| Problema | Text | Scor | 40 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva de probleme | Marime | 0.51 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[100005], *p;
while(cin.get(s, 100005))
{
p=strtok(s, caractere);
while(p!=NULL)
{
l+=strlen(p);
cnt++;
p=strtok(NULL, caractere);
}
cin.get();
}
cout << l/cnt;
}
