fork download
  1. fun main() {
  2. weatherCity("Ankara", 27, 31, 82)
  3. weatherCity("Tokyo", 32, 36, 10)
  4. weatherCity("Cape Town", 59, 64, 2)
  5. weatherCity("Guatemala City", 50, 55, 7)
  6. }
  7.  
  8. fun weatherCity(
  9. city: String,
  10. low: Int,
  11. high: Int,
  12. chanceOfRain: Int
  13. ) {
  14. println("City: $city")
  15. println("Low temperature: $low, High temperature: $high")
  16. println("Chance of rain: $chanceOfRain%")
  17. println()
  18. }
Success #stdin #stdout 0.08s 38048KB
stdin
Standard input is empty
stdout
City: Ankara
Low temperature: 27, High temperature: 31
Chance of rain: 82%

City: Tokyo
Low temperature: 32, High temperature: 36
Chance of rain: 10%

City: Cape Town
Low temperature: 59, High temperature: 64
Chance of rain: 2%

City: Guatemala City
Low temperature: 50, High temperature: 55
Chance of rain: 7%