Cod sursa(job #2422044)
Utilizator | Data | 16 mai 2019 22:18:11 | |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.32 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream in("text.in");
ofstream out("text.out");
string x;
vector<int> y;
int main(){
int sum = 0;
while(!in.eof()){
x.empty();
getline(in, x, ' ');
y.push_back(x.size());
}
for (int i = 0; i < y.size(); i++){
sum += y[i];
}
cout << sum/y.size() - 1;
return 0;
}