Skip to content

Instantly share code, notes, and snippets.

@nandanhere
nandanhere / Readline
Last active October 29, 2020 04:20 — forked from TheNova22/Readline
Readline Operations
// vim: syntax=swift
let line = Int(readLine()!)!
let line1 = readLine()!.split(separator: " ").map{ Int(String($0))! }
let numbers = readLine()!.components(separatedBy: [" "]).map { Int($0)! }
// to print a double / float with x precision
print(format:"%.xf",double_variable_here)