Cod sursa(job #786306)
Utilizator | Data | 10 septembrie 2012 22:35:41 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.39 kb |
#include<fstream>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int lit,cuv;
char c;
void text()
{
short ok = 0;
while(f.get(c))
{
if((c >= 'a' && c<= 'z') || (c >= 'A' && c <= 'Z'))
{
lit++;
if(ok == 0)
cuv ++;
ok = 1;
}
else
ok = 0;
}
}
int main()
{
text();
g<<lit/cuv<<'\n';
g.close();
return 0;
}