Cod sursa(job #2237631)
| Utilizator | Data | 2 septembrie 2018 14:29:48 | |
|---|---|---|---|
| Problema | Text | Scor | 40 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.45 kb |
#include <iostream>
#include <string>
#include <fstream>
#include <vector>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int main(){
vector<int> words;
string word;
while(!fin.eof()){
fin >> word;
words.push_back(word.length());
}
int total = 0;
for(auto i = 0;i < words.size()-1;i++){
total += words[i];
}
fout << (int)(total/words.size());
fin.close();
fout.close();
return 0;
}
