This commit is contained in:
Ingy döt Net 2013-10-27 22:24:23 +00:00
parent 6f050a029e
commit 776bba907c
3887 changed files with 59894 additions and 7280 deletions

View file

@ -0,0 +1,2 @@
INPUT "Enter a string"; s$
INPUT "Enter a number: ", i%

View file

@ -0,0 +1,2 @@
10 INPUT "ENTER A STRING: "; S$
20 INPUT "ENTER A NUMBER: ", I%

View file

@ -1,3 +1,3 @@
@echo off
set /p var=
echo %var%
echo %var% 75000

View file

@ -0,0 +1,17 @@
IDENTIFICATION DIVISION.
PROGRAM-ID. Get-Input.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 Input-String PIC X(30).
01 Input-Int PIC 9(5).
PROCEDURE DIVISION.
DISPLAY "Enter a string:"
ACCEPT Input-String
DISPLAY "Enter a number:"
ACCEPT Input-Int
GOBACK
.

View file

@ -0,0 +1,16 @@
:- object(user_input).
:- public(test/0).
test :-
repeat,
write('Enter an integer: '),
read(Integer),
integer(Integer),
!,
repeat,
write('Enter an atom: '),
read(Atom),
atom(Atom),
!.
:- end_object.

View file

@ -0,0 +1,4 @@
| ?- user_input::test.
Enter an integer: 75000.
Enter an atom: 'Hello world!'.
yes

View file

@ -0,0 +1,15 @@
#lang racket
(printf "Input a string: ")
(define s (read-line))
(printf "You entered: ~a\n" s)
(printf "Input a number: ")
(define m (or (string->number (read-line))
(error "I said a number!")))
(printf "You entered: ~a\n" m)
;; alternatively, use the generic `read'
(printf "Input a number: ")
(define n (read))
(unless (number? n) (error "I said a number!"))
(printf "You entered: ~a\n" n)

View file

@ -1,4 +1,4 @@
print("Enter a number: ")
val i=Console.readInt
val i=Console.readLong // Task says to enter 75000
print("Enter a string: ")
val s=Console.readLine