Cod sursa(job #599300)
| Utilizator | Data | 28 iunie 2011 14:38:26 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.46 kb |
#include<fstream>
#include<cstring>
#include<iostream>
using namespace std;
int main()
{char c;
int cuv=0,lit=0;
ifstream f("text.in");
while (!f.eof())
{c=f.get();
if ((c>='a' && c<='z') || (c>='A'&& c<='Z'))
{cuv++;
while ((c>='a' && c<='z') || (c>='A'&& c<='Z'))
{lit++;
c=f.get();
if (c=='-')
{cuv++;
c=f.get();
}
}
}
}
ofstream g("text.out");
cout<<lit/cuv;
g<<lit/cuv;
f.close();
g.close();
return 0;
}
