Pagini recente » Cod sursa (job #2740160) | Cod sursa (job #1932636) | Cod sursa (job #1468925) | Cod sursa (job #2228077) | Cod sursa (job #2774294)
/* [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);
int len(0), w(0);
string word = "";
for (auto x : str) {
if (x == ' ' || x == ',' || x == '.' ||
x == '!' || x == '?' || x == '-') {
if (word.size())
w++, len += word.size();
word = "";
}
else word += x;
}
if (word.size())
w++, len += word.size();
fout << len / w;
}