Cod sursa(job #791135)

Utilizator AndupkIonescu Alexandru Andupk Data 23 septembrie 2012 09:04:25
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.43 kb
#include<cstdio>
#include<string>
using namespace std;
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
char ch;
long long car=0,cuv=0;
bool ok=0;
while(!feof(stdin))
{
  scanf("%c",&ch);  
   if( (ch<='Z' && ch>='A' )|| ( ch<='z' && ch>='a'))
      {
          ok=1;
          car++; 
      }	   
   else
	   if(ok)
	   {
	    cuv++;
		ok=0;
	   }
}
printf("%lld",car/cuv);
return 0;	
}