Cod sursa(job #356185)
Utilizator | Data | 13 octombrie 2009 19:17:27 | |
---|---|---|---|
Problema | Text | Scor | 10 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.34 kb |
#include<string.h>
#include<fstream.h>
int main()
{
int l,L,x,ok;
char c;
ifstream f("text.in");
ofstream g("text.out");
l=0; L=0;
ok=1;
while(f>>c)
{
if(isalpha(c))
{
L++;
if(ok==0)l++;
ok=1;
}
else ok=0;
}
x=L/l;
g<<L/l;
f.close();
g.close();
return 0;
}