Cod sursa(job #175287)
| Utilizator | Data | 9 aprilie 2008 20:12:22 | |
|---|---|---|---|
| Problema | Text | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.49 kb |
#include<io.h>
#include<string.h>
#include<fstream>
#include<stdio.h>
using namespace std;
const char litere[]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
int main()
{long long k=0,nr_cuv=0,lungime=0;
char s,*p;
fstream f("text.in",ios::in);
fstream g("text.out",ios::out);
while(f.get(s))
{p=strrchr(litere,s);
if(p)
{lungime++;
if(k==0)
nr_cuv++;
k=1;
}
else
k=0;
}
g<<lungime/nr_cuv;
g.close();
f.close();
return 0;
}
