Cod sursa(job #757465)
Utilizator | Data | 12 iunie 2012 09:46:05 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.41 kb |
#include <fstream>
using namespace std;
int lit, nrcuv;
char bef, c;
int main()
{
ifstream f ("text.in");
ofstream g ("text.out");
while(f.get(c)) {
if((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')) {
++lit;
if(!((bef >= 'a' && bef <= 'z') || (bef >= 'A' && bef <= 'Z')))
++nrcuv;
}
bef = c;
}
g << lit / nrcuv;
return 0;
}