Pagini recente » Cod sursa (job #293570) | Cod sursa (job #2648196) | Cod sursa (job #2728636) | Cod sursa (job #60757) | Cod sursa (job #1595321)
#include <cstdio>
#include <iostream>
#include <set>
#include <climits>
#include <map>
#include <algorithm>
#include <list>
#include <vector>
#include <utility>
#include <cstdlib>
#include <iomanip>
#include <cstring>
#include <string>
using namespace std;
bool isChar(char c) {
return (((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z')));
}
int main() {
// freopen("tt.txt", "r", stdin);
freopen("text.in", "r", stdin);
freopen("text.out", "w", stdout);
// ios::sync_with_stdio(false);
// cin.tie(0);
bool isWord = false;
int totalWord = 0, totalChar = 0;
char c;
while (true) {
c = getchar();
if (isChar(c)) {
isWord = true;
totalChar++;
} else if (isWord) {
isWord = false;
totalWord++;
}
if (c == -1)
break;
}
cout << totalChar / totalWord;
return 0;
}