Cod sursa(job #1047348)
Utilizator | Data | 4 decembrie 2013 11:42:23 | |
---|---|---|---|
Problema | Text | Scor | 70 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.36 kb |
#include <iostream>
#include <fstream>
#include <string.h>
using namespace std;
int main()
{
ifstream f ("text.in");
ofstream g ("text.out");
string da;
int cifre=0,cuvinte=0;
while(!f.eof() && f>>da)
{
cuvinte++;
cifre+=da.size();
}
g<<cifre/cuvinte;
f.close();
g.close();
return 0;
}