Cod sursa(job #652490)
Utilizator | Data | 24 decembrie 2011 18:12:25 | |
---|---|---|---|
Problema | Text | Scor | 90 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.37 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream f("text.in");
ofstream h("text.out");
int valid(char a)
{
if ((a>='a' && a<='z')|| (a>='A'&& a<='Z') )
return 1;
return 0;
}
int main()
{
char cuv,g;
int c=0,l=0;
while (!f.eof())
{
f.get(cuv);
if(valid(cuv))
{
l++;
g=1;
}
else if(g)
{ c++;
g=0;
}
}
h<<l/c;
return 0;
}