Cod sursa(job #1246922)
Utilizator | Data | 21 octombrie 2014 20:03:33 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.43 kb |
#include <iostream>
#include <fstream>
#include <cmath>
using namespace std;
int main()
{
ifstream in("text.in");
ofstream out("text.out");
unsigned int cuvinte = 0;
unsigned int lungime = 0;
string curent;
while (true){
in >> curent;
cuvinte++;
if ( in.eof() ) break;
lungime += curent.length();
}
out << floor(lungime/cuvinte);
return 0;
}