Pagini recente » Cod sursa (job #1791961) | Cod sursa (job #3185445) | Cod sursa (job #581428) | Cod sursa (job #1927156) | Cod sursa (job #2774295)
/* [A][M][C][B][N] / [K][R][I][P][6][8] */
#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
// Global variables
const char sp = ' ', nl = '\n';
const int MOD = 777013; // 666013 998244353 1000000007
ifstream fin("text.in");
ofstream fout("text.out");
int main() {
string str;
getline(fin, str);
for (int i = 0; i < str.size(); i++)
if (!isalnum(str[i]))
str[i] = ' ';
int len(0), w(0);
string word = "";
for (auto x : str) {
if (x == ' ') {
if (word.size())
w++, len += word.size();
word = "";
}
else word += x;
}
if (word.size())
w++, len += word.size();
fout << len / w;
}