Cod sursa(job #703177)
Utilizator | Data | 2 martie 2012 11:19:21 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.31 kb |
#include<fstream>
#include<string>
#include<iostream>
using namespace std;
char c;
ifstream f("text.in");
ofstream g("text.out");
int j,nr,ok;
int main()
{while(f.get(c))
{
if((c>='a'&&c<='z')||(c>='A'&&c<='Z'))
{j++;ok=1;}
else
if(ok)
{nr++;ok=0;}
}f.close();
g<<j/nr;
g.close();
return 0;
}