Cod sursa(job #171607)

Utilizator rEbyTerHerpesius rEbyTer Data 4 aprilie 2008 17:32:04
Problema Text Scor 70
Compilator cpp Status done
Runda Arhiva de probleme Marime 1.28 kb
//Friday, April 04 2008
//Source created by Harabula Adrian
//for infoarena.ro
/*
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdio.h>

int branza_dulce(char c)
{
  int i=int(c);
  if((i>=65&&i<=90)||(i>=97&&i<=122) ) return 1;
  return 0;
}

int main()
{char curte;
  char l='|';
int l_mama=0,l_tata=0;
  freopen("text.in","r",stdin);
  freopen("text.out","w",stdout);
  while( (scanf("%c",&curte))!=EOF )
    { if( branza_dulce(curte)&&l!='|'&&!(branza_dulce(l))) l_tata++;
      if(branza_dulce(curte)) l_mama++;
      l=curte;
    }
  printf("%d",l_mama/l_tata);
  //  I was here
  // rEbyTer was here
  // http://89.43.162.48  available only when my computer is online 
  return 0;
}