Skip to content

Instantly share code, notes, and snippets.

@rail-rate
Created August 14, 2019 18:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rail-rate/a821cd210dd9b7eb9b6209f3a03b3b7f to your computer and use it in GitHub Desktop.
Save rail-rate/a821cd210dd9b7eb9b6209f3a03b3b7f to your computer and use it in GitHub Desktop.
main外3
fun main(args: Array<String>) {
val ans = cal(3, 5) //ここで2つの値をかっこの中に書く。
println(ans)
}
fun cal(x : Int, y : Int) : Int{ //2つの値を変数xとyに代入 
println(x) //xが3であることが分かる。
return x * y //main関数のかっこの中最初の数字がcal関数の最初の変数になってることが分かる
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment