Cod sursa(job #356169)
Utilizator | Data | 13 octombrie 2009 18:38:03 | |
---|---|---|---|
Problema | Text | Scor | 20 |
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=0;
while(f>>c)
{
if(isalpha(c)){L++;ok=1;}
else if(ok==1) {l++;ok=0;}
}
x=L/l;
g<<l;
f.close();
g.close();
return 0;
}