Cod sursa(job #609083)
Utilizator | Data | 19 august 2011 15:24:38 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.37 kb |
#include<fstream>
#include<string>
using namespace std;
char c;
long l,k,lc,i;
int main()
{
ifstream f("text.in");ofstream g("text.out");
while(!f.eof())
{
f.get(c);
if(isalpha(c))//verifica daca e litera
{
while(!f.eof() && isalpha(c))
{
l++;
f.get(c);
}
k++;
}
}
g<<l/k;
f.close();g.close();
return 0;}