import Foundation
print("Type your age: ")
if let input = readLine() {
print("You typed \(input)\n")
}
**我以前用过,但是我不知道如何添加它们并将其显示在控制台中。
import Foundation
print("enter number one: ")
var sum = 0
if let num1 = Int(readLine()!) {
sum += num1
}
print("enter number two: ")
if let num2 = Int(readLine()!) {
sum += num2
}
print(sum)