Oktatás * Programozás 2 * Szkriptnyelvek * levelezősök Félévek Linkek * kalendárium |
Nim /
20180617hexceptionsimport strformat import strutils proc input(text: string = ""): string = stdout.write(text) stdin.readLine() try: let age = input("Your age: ").parseInt() echo &"Next year you'll be {age+1}" except ValueError: echo "That's not a number!" Output: Your age: 28 Next year you'll be 29 Your age: Lac That's not a number! |
Blogjaim, hobbi projektjeim * The Ubuntu Incident [ edit ] |