Cod sursa(job #29257)
Utilizator | Data | 8 martie 2007 20:29:57 | |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.42 kb |
#include<fstream.h>
#include<string.h>
#define input "text.in"
#define output "text.out"
int main()
{
ifstream fin(input);
char b;
int s,n,i,x,ant=0;
s=0;
while( !fin.eof() )
{
fin.get(b);
x=int(b);
if(x>=65&&x<=90||x>=97&&x<=122)
{
if(ant==0)
{
ant++;
s++;
}
n++;
}
else
ant=0;
}
ofstream fout(output);
fout<<n/s;
return 0;
}