为了账号安全,请及时绑定邮箱和手机立即绑定
var coordinate = (1,1)
switch coordinate
{
case (0,0):
    println("It's at origin!")
case (1,0):
    println("It's an unit vector on the positive x-axis.")
case (-1,0):
    println("It's an unit vector on the negative x-axis.")
case (0,1):
    println("It's an unit vector on the positive y-axis.")
case (0,-1):
    println("It's an unit vector on the negative y-axis.")
default:
    println("It's just an ordinary coordinate.")
    
}

switch coordinate
{
case (0,0):
    println("It's at origin!")
case (_,0):
    println("(\(coordinate.0),0) is on the x-axis.")
case (0,_):
    println("(0,\(coordinate.0)) is on the y-axis.")
default:
    println("(\(coordinate.0),\(coordinate.1)) is just an ordinary coordinate.")
}


正在回答

0 回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号