Cod sursa(job #252946)
Utilizator | Data | 5 februarie 2009 10:40:12 | |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.3 kb |
#include<fstream>
using namespace std;
ifstream f1("text.in");
ofstream f2("text.out");
int main()
{
char c;
int cuv=0,lit=0;
int v=0;
while (f1>>c)
if (c>=65 && c<=122 && c!=0) v++;
else if(v>0) {lit+=v; v=0; cuv++;}
f2<<lit/cuv;
f1.close();
f2.close();
return 0;
}