Cod sursa(job #24623)
| Utilizator | Data | 3 martie 2007 02:35:36 | |
|---|---|---|---|
| Problema | Text | Scor | 60 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.37 kb |
#include<iostream.h>
#include<string.h>
#include<fstream.h>
main()
{char c,sep[]=" .,!-?:;",*p;
long long lit,ok,cuv;
ifstream f1("text.in");
ofstream f2("text.out");
lit=0; cuv=0; ok=0;
while (!f1.eof())
{f1.get(c);
p=strchr(sep,c);
if (p==NULL)
{lit++;
if (ok==0)
cuv++;
ok=1;}
else
ok=0;
}
ok=lit/cuv;
f2<<ok;
f1.close();
f2.close();}