Cod sursa(job #652476)
| Utilizator | Data | 24 decembrie 2011 17:17:33 | |
|---|---|---|---|
| Problema | Text | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.38 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;
int c=0,l=0;
while (!f.eof())
{
f.get(cuv);
if(valid(cuv))
l++;
else if(l)
c++;
}
if (valid(cuv))
c++;
l-=1;
l=l/c;
h<<l;
return 0;
} 