Cod sursa(job #557347)
Utilizator | Data | 16 martie 2011 16:37:06 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.32 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();
if(isalpha(c))
nr++;
ofstream out("text.out");
out<<s/nr<<'\n';
out.close();
return 0;
}