Cod sursa(job #609081)
Utilizator | Data | 19 august 2011 15:21:48 | |
---|---|---|---|
Problema | Text | Scor | 70 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.39 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((c>='a' && c<='z') || (c>='A' && c<='Z'))
{
while((c>='a' && c<='z') || (c>='A' && c<='Z'))
{
l++;
f.get(c);
}
k++;
}
}
g<<l/k;
f.close();g.close();
return 0;}