Cod sursa(job #2820699)
Utilizator | Tudose Filip filiptudose2007 | Data | 21 decembrie 2021 11:38:26 |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | cex02 | Marime | 0.55 kb |
#include <bits/stdc++.h>
using namespace std;
int let,word;
char s[10000000];
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
cin.sync_with_stdio(false);
cin.tie(0);
while(cin>>s)
{
char ult=' ';
int n=strlen(s);
for(int i=0; i<n; ++i)
{
if(isalpha(s[i]))
{
let++;
if(!isalpha(ult))word++;
}
ult=s[i];
}
}
cout<<let/word;
return 0;
}