Cod sursa(job #409150)
Utilizator | Data | 3 martie 2010 14:39:21 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.33 kb |
#include <fstream.h>
#include <string.h>
ifstream f("text.in");
ofstream g("text.out");
int main()
{char v[1000],a;
f.getline(v,1000,'\n');
int i,l,c,x;l=0;i=0;c=0;x=0;
while(v[i]!=NULL)
{a=v[i];
if((a>='a' && a<='z') || (a>='A' && a<='Z')) {l++;x=1;}
if((a==' ' || a=='-') && x==1) c++;
i++;}
c++;
g<<l/c;return 0;}