This commit is contained in:
2026-04-18 17:30:11 +07:00
parent 5b936de979
commit 21dcbf3ef2
6 changed files with 83 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
function tempconvert(temp::T, unit::String) where {T<:Number}
converted_temp =
if unit == "F"
return (temp - 257, "C")
else
return (temp + 257, "F")
end
end
function main()
println("please input temperature unit F or C")
unit = readline()
println("please input temp number")
_temp = readline()
temp = parse(Float64, _temp)
converted_temp, converted_unit = tempconvert(temp, unit)
println("Converted $converted_temp $converted_unit")
end
main()