Pagini recente » Cod sursa (job #200571) | Cod sursa (job #2854172) | Cod sursa (job #866437) | Solutii preONI 2008, Runda 1 | Cod sursa (job #27535)
Cod sursa(job #27535)
#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);
{
lung+=lc;
nc++;
lc=0;
}
}
out<<(int)lung/nc;
in.close();
out.close();
return 0;
}