TEL:400-8793-956
当前位置:程序、服务器

我怎样才能迅速地乘以firstValue和secondValue

提问者: 近期获赞: 浏览人数: 发布时间:2021-03-10 10:38:36

 问:我在使用let firstValue = 10 let secondValue = 20 let product = firstValue * secondValue let interpolatedString =“(firstValue)乘以(secondValue)的乘积是(product)的乘积中出错。”

 
 类型
//在下面输入您的代码
let  firstValue  =  10 
let  secondValue  =  20 
let  product  =  firstValue  *  secondValue 
let  interString  =  “ \(firstValue )乘以\(secondValue )的值为\(product )”
 
 
答:您的代码是正确的,只需确保将您的最终字符串常量命名为output,而不是interString。
 
将此字符串分配给名为的常量 output
 
让 firstValue  =  10
让 secondValue  =  20
让 乘积 =  firstValue  *  secondValue
让 输出 =  “ \(firstValue )乘以\(secondValue )的乘积是\(product )”
上一篇: 使用findViewById()方法(如其上方的TextView)初始化showFactButton变量
下一篇: 用PHP中的逗号(,)替换连字符(-)