Cod sursa(job #411732)
Utilizator | Data | 5 martie 2010 09:27:03 | |
---|---|---|---|
Problema | Text | Scor | 90 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.35 kb |
#include<fstream>
using namespace std;
char c;
int l,n,k=0;
int main()
{
ifstream in("text.in");
while(in.get(c))
{
if((c>=65&&c<=90)||(c>=97&&c<=122))
{
n++,k=1;
if(in.eof()) l++;
}
else if(k==1) l++,k=0;
}
if((c>=65&&c<=90)||(c>=97&&c<=122)) n++;
ofstream out("text.out");
out<<n/l;
return 0;
}