Cod sursa(job #96057)
| Utilizator | Data | 31 octombrie 2007 11:29:24 | |
|---|---|---|---|
| Problema | Text | Scor | 70 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.43 kb |
#include<fstream.h>
#include<iostream.h>
#include<iomanip.h>
#define cuvant (s>='a' && s<='z') || (s>='A' && s<='Z')
fstream f("text.in",ios::in),g("text.out",ios::out);
long nrcuv,nrlit; char s;
int ga=0,status=1,k=0;
int main()
{
//f.get(s);
while(f.get(s))
{
if(cuvant)
{ga=1;
nrlit++;}
else if(ga)
{nrcuv++;
ga=0;}
//f.get(s);
}
//if(nrcuv==0)
//g<<0;
//else
g<<nrlit/++nrcuv;
}
