daily pastebin goal
5%
SHARE
TWEET

Untitled

a guest Mar 25th, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. object main extends App
  2. {
  3.     def count(str: String) : Int =
  4.     {
  5.         def countHelp(str: String, place: Int, smallLetters: Int) =
  6.         {
  7.             if(place == str.length - 1)
  8.             {
  9.                 return smallLetters
  10.             }
  11.             else if(str(place).toInt >= 97 && str(place).toInt <= 122)
  12.             {
  13.                 countHelp(str, place + 1, smallLetters + 1)
  14.             }
  15.             else
  16.             {
  17.                 countHelp(str, place + 1, smallLetters)
  18.             }
  19.            
  20.         }
  21.         countHelp(str, 0, 0)
  22.     }
  23.  
  24.     print("Podaj slowo: ")
  25.     var word = io.StdIn.readLine()
  26.     print("Malych liter jest"+count(word))
  27. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top