Cod sursa(job #11560)
Utilizator | HighScore skyel | Data | 31 ianuarie 2007 21:08:15 |
---|---|---|---|
Problema | Text | Scor | 10 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.39 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,ant=0,x;
s=0;
while( !fin.eof() )
{
fin>>b;
if(b>=65&&b<=90||b>=97&&b<=122)
{
n++;
ant=1;
}
else
if(ant)
{
s++;
ant=0;
}
}
ofstream fout(output);
fout<<n/s;
return 0;
}