Cod sursa(job #1247384)

Utilizator gabrielmGabriel Majeri gabrielm Data 22 octombrie 2014 18:25:40
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 long long int cuvinte = 1;
    unsigned long long int lungime = 0;
    string curent;

    while( true ){
        if(!(in >> curent)) break;
        cuvinte++;
        lungime += curent.length();
    }

    out << floor(lungime/cuvinte);

    return 0;
}