Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
18
Task/User-input-Text/Fantom/user-input-text.fantom
Normal file
18
Task/User-input-Text/Fantom/user-input-text.fantom
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
class Main
|
||||
{
|
||||
public static Void main ()
|
||||
{
|
||||
Env.cur.out.print ("Enter a string: ").flush
|
||||
str := Env.cur.in.readLine
|
||||
echo ("Entered :$str:")
|
||||
Env.cur.out.print ("Enter 75000: ").flush
|
||||
Int n
|
||||
try n = Env.cur.in.readLine.toInt
|
||||
catch (Err e)
|
||||
{
|
||||
echo ("You had to enter a number")
|
||||
return
|
||||
}
|
||||
echo ("Entered :$n: which is " + ((n == 75000) ? "correct" : "wrong"))
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue