Cod sursa(job #2093055)
Utilizator | Data | 22 decembrie 2017 20:28:51 | |
---|---|---|---|
Problema | Text | Scor | 70 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.46 kb |
#include<bits/stdc++.h>
using namespace std;
int words, letters;
string word;
int main()
{
freopen("text.in", "r", stdin);
freopen("text.out", "w", stdout);
while(cin >> word)
{
bool atLeastItIsAWord = false;
for(char i : word)
{
if(isalpha(i)) letters++, atLeastItIsAWord = true;
}
if(atLeastItIsAWord) words++;
}
cout << letters / words;
return 0;
}