Cod sursa(job #3272988)
Utilizator | Data | 31 ianuarie 2025 22:10:41 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.42 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream in("text.in");
ofstream out("text.out");
int main() {
string s;
getline(in, s);
int length = 0, count = 0;
regex r("[a-zA-Z0-9]+");
for (auto it = sregex_iterator(s.begin(), s.end(), r); it != sregex_iterator(); it++) {
length += it->str().size();
count++;
}
out << length / count;
return 0;
}