Pagini recente » Cod sursa (job #2819840) | Cod sursa (job #2425982) | Cod sursa (job #1736829) | Profil zsedcftgb | Cod sursa (job #2237632)
#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(int i = 0;i < words.size()-1;i++){
total += words[i];
}
fout << (int)(total/words.size());
fin.close();
fout.close();
return 0;
}