Cod sursa(job #356172)
Utilizator | Data | 13 octombrie 2009 18:41:40 | |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.32 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=1; L=0;
ok=1;
while(f>>c)
{
ok=1;
if(isalpha(c)){L++;ok=1;}
else if(ok==1) {l++;ok=0;}
}
x=L/l;
g<<L/l;
f.close();
g.close();
return 0;
}