Cod sursa(job #179348)
Utilizator | Data | 15 aprilie 2008 20:19:09 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.4 kb |
#include<fstream.h>
#include<string.h>
int main()
{
ifstream fin("text.in");
ofstream fout("text.out");
char c;
int lit=0,cuv=0,flag=0;
while(fin.get(c))
if(strchr("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",c)!=NULL)
{
lit++;
flag=1;
}
else
if(c==' ' || c=='-' && flag)
cuv++;
fout<<lit/cuv;
fin.close();
fout.close();
return 0;
}