Cod sursa(job #467481)
Utilizator | Data | 29 iunie 2010 00:45:41 | |
---|---|---|---|
Problema | Text | Scor | 10 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.35 kb |
#include<fstream>
#include<math.h>
using namespace std;
int main()
{
char text[1000][1000];
ifstream fin;
ofstream fout;
fin.open("text.in");
int i=1, nr=0;
while(!fin.eof())
{
fin>>text[i];
nr+= strlen(text[i]);
i++;
}
fin.close();
fout.open("text.out");
fout<<nr/i-1;
fout.close();
return 0;
}