Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
22
Task/Integer-comparison/Wren/integer-comparison.wren
Normal file
22
Task/Integer-comparison/Wren/integer-comparison.wren
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import "io" for Stdin, Stdout
|
||||
|
||||
System.print("Enter anything other than a number to quit at any time.\n")
|
||||
while (true) {
|
||||
System.write(" First number : ")
|
||||
Stdout.flush()
|
||||
var a = Num.fromString(Stdin.readLine())
|
||||
if (!a) break
|
||||
System.write(" Second number : ")
|
||||
Stdout.flush()
|
||||
var b = Num.fromString(Stdin.readLine())
|
||||
if (!b) break
|
||||
var s = (a-b).sign
|
||||
if (s < 0) {
|
||||
System.print(" %(a) < %(b)")
|
||||
} else if (s == 0) {
|
||||
System.print(" %(a) == %(b)")
|
||||
} else {
|
||||
System.print(" %(a) > %(b)")
|
||||
}
|
||||
System.print()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue