Cod sursa(job #411702)
Utilizator | Data | 5 martie 2010 08:50:15 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.37 kb |
#include<fstream>
using namespace std;
int l, n;
char c1, c2;
ifstream in("text.in");
int main()
{
c1=' ';
while(!in.eof())
{
in.get(c2);
if(c2>='a' && c2<='z' || c2>='A' && c2<='Z')
{
l++;
if(!(c1>='a' && c1<='z' || c1>='A' && c1<='Z'))
n++;
}
c1=c2;
}
ofstream out("text.out");
out<<l/n;
out.close();
return 0;
}