Cod sursa(job #557341)
Utilizator | Data | 16 martie 2011 16:32:55 | |
---|---|---|---|
Problema | Text | Scor | 90 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.3 kb |
#include<fstream>
using namespace std;
long long s,nr,cr;
int main()
{char c;
ifstream in("text.in");
in.get(c);
while(!in.eof())
{if(isalpha(c))
s++,cr++;
else
if(cr>0)
nr++,cr=0;
in.get(c);
}
in.close();
ofstream out("text.out");
out<<s/nr<<'\n';
out.close();
return 0;
}