import Foundation while let line = readLine() { if let value = UInt(line.replacingOccurrences(of: "0x", with: ""), radix: 16) { print(value) } }