Cod sursa(job #27530)
| Utilizator | Data | 6 martie 2007 14:57:14 | |
|---|---|---|---|
| Problema | Text | Scor | 20 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.44 kb |
#include"fstream.h"
#include"string.h"
int main()
{
ifstream in("text.in");
ofstream out("text.out");
long lung=0,nc=0,lc=0;
int i;
char c[2];
while(!in.eof())
{
in.get(c,2);
if( ((strcmp(c,"a")>=0) && (strcmp(c,"z")<=0))||((strcmp(c,"A")>=0)&&(strcmp(c,"Z")<=0)))
lc++;
else
if(lc==0);
else
{
lung+=lc;
nc++;
lc=0;
}
}
out<<(int)lung/nc;
in.close();
out.close();
return 0;
}