Cod sursa(job #237196)

Utilizator shnakoVlad Schnakovszki shnako Data 29 decembrie 2008 11:29:03
Problema Text Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.39 kb
#include <stdio.h>
#include <fstream.h>
#include <ctype.h>
ifstream f("text.in");
ofstream g("text.out");
int s=0, c;
bool sw=0, swx;
char x;
int main()
{
while(!EOF)
	{
   f.get(x);
   swx=0;
   if (isalpha(x))
   	{
      swx=1;
      sw=1;
    	s++;
      }
   else
   	if (sw&&!swx)
   	{
      sw=0;
      c++;
      }
   }
g<<s/c;
f.close();
g.close();
return 0;
}