Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import Foundation
- print ("1 from f to c")
- print ("2 from c to f")
- var result = readLine()!
- if (Int (result) == 1) {
- var f = readLine()!
- var c = 5.0/9.0 * (Double (f)! - 32)
- print ("C:",c)
- }else if (Int (result) == 2){
- var c = readLine()!
- var f = 9.0/5.0 * Double (c)! + 32
- print ("f:",f)
- } else {
- print ("please chose 1 or 2")
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement