Cod sursa(job #2940172)
| Utilizator | Data | 14 noiembrie 2022 22:23:03 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva de probleme | Marime | 0.55 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
inline bool word(char c)
{
return ((c >= 'a' && c <= 'z') || (c >= 'A' && c <='Z'));
}
int main()
{
int cnt = 0, len = 0, no = 0;
char c;
while(fin >> noskipws >> c)
{
if(word(c))
{
if(!cnt)
{
no++, cnt = 1;
}
len++;
}
else
cnt = 0;
}
if(no)
fout << len / no;
else
fout << 0;
}
