Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1,14 +0,0 @@
|
|||
function Get_String return String is
|
||||
Line : String (1 .. 1_000);
|
||||
Last : Natural;
|
||||
begin
|
||||
Get_Line (Line, Last);
|
||||
return Line (1 .. Last);
|
||||
end Get_String;
|
||||
|
||||
function Get_Integer return Integer is
|
||||
S : constant String := Get_String;
|
||||
begin
|
||||
return Integer'Value (S);
|
||||
-- may raise exception Constraint_Error if value entered is not a well-formed integer
|
||||
end Get_Integer;
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
My_String : String := Get_String;
|
||||
My_Integer : Integer := Get_Integer;
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
with Ada.Text_IO, Ada.Integer_Text_IO;
|
||||
|
||||
procedure User_Input is
|
||||
I : Integer;
|
||||
begin
|
||||
Ada.Text_IO.Put ("Enter a string: ");
|
||||
declare
|
||||
S : String := Ada.Text_IO.Get_Line;
|
||||
begin
|
||||
Ada.Text_IO.Put_Line (S);
|
||||
end;
|
||||
Ada.Text_IO.Put ("Enter an integer: ");
|
||||
Ada.Integer_Text_IO.Get(I);
|
||||
Ada.Text_IO.Put_Line (Integer'Image(I));
|
||||
end User_Input;
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
with
|
||||
Ada.Text_IO,
|
||||
Ada.Integer_Text_IO,
|
||||
Ada.Strings.Unbounded,
|
||||
Ada.Text_IO.Unbounded_IO;
|
||||
|
||||
procedure User_Input2 is
|
||||
S : Ada.Strings.Unbounded.Unbounded_String;
|
||||
I : Integer;
|
||||
begin
|
||||
Ada.Text_IO.Put("Enter a string: ");
|
||||
S := Ada.Strings.Unbounded.To_Unbounded_String(Ada.Text_IO.Get_Line);
|
||||
Ada.Text_IO.Put_Line(Ada.Strings.Unbounded.To_String(S));
|
||||
Ada.Text_IO.Unbounded_IO.Put_Line(S);
|
||||
Ada.Text_IO.Put("Enter an integer: ");
|
||||
Ada.Integer_Text_IO.Get(I);
|
||||
Ada.Text_IO.Put_Line(Integer'Image(I));
|
||||
end User_Input2;
|
||||
|
|
@ -1,3 +1,6 @@
|
|||
@echo off
|
||||
set /p var=
|
||||
echo %var% 75000
|
||||
setlocal enableextensions
|
||||
set /p istr=
|
||||
set /p inum=
|
||||
set /a val=inum
|
||||
if not "%val%"=="75000" echo Second input should be 75000.
|
||||
|
|
|
|||
|
|
@ -1,17 +0,0 @@
|
|||
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
|
||||
.
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
import extensions;
|
||||
|
||||
public program()
|
||||
public Program()
|
||||
{
|
||||
var num := new Integer();
|
||||
console.write("Enter an integer: ").loadLineTo(num);
|
||||
Console.write("Enter an integer: ").loadLineTo(num);
|
||||
|
||||
var word := console.write("Enter a String: ").readLine()
|
||||
var word := Console.write("Enter a String: ").readLine()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +0,0 @@
|
|||
include get.e
|
||||
|
||||
sequence s
|
||||
atom n
|
||||
|
||||
s = prompt_string("Enter a string:")
|
||||
puts(1, s & '\n')
|
||||
n = prompt_number("Enter a number:",{})
|
||||
printf(1, "%d", n)
|
||||
|
|
@ -1,30 +1,29 @@
|
|||
PROC usrinpt:
|
||||
LOCAL string$(15),number&
|
||||
WHILE string$=""
|
||||
PROC main:
|
||||
LOCAL s$(15),l&
|
||||
WHILE s$=""
|
||||
PRINT "Please enter a string."
|
||||
INPUT string$
|
||||
IF string$=""
|
||||
INPUT s$
|
||||
IF s$=""
|
||||
PRINT "Nothing was entered. Please try again."
|
||||
PAUSE 60
|
||||
CLS
|
||||
ENDIF
|
||||
ENDWH
|
||||
PRINT "Thank you! You entered: ";string$
|
||||
WHILE number&<>75000
|
||||
PRINT "Thank you! Yoe entered: ";s$
|
||||
WHILE l&<>75000
|
||||
PRINT "Please enter the number 75000."
|
||||
TRAP INPUT number&
|
||||
TRAP INPUT l&
|
||||
IF ERR=-1
|
||||
PRINT
|
||||
PRINT "That's not a valid number. Please try again."
|
||||
PAUSE 60
|
||||
CLS
|
||||
ELSEIF number&<>75000
|
||||
ELSEIF l&<>75000
|
||||
PRINT "Wrong number. Please try again."
|
||||
PAUSE 60
|
||||
CLS
|
||||
ENDIF
|
||||
ENDWH
|
||||
PRINT "Good job! You successfully entered 75000!"
|
||||
PRINT "Press any key to continue."
|
||||
PRINT "Good job! You succesfully entered 75000!"
|
||||
GET
|
||||
ENDP
|
||||
|
|
|
|||
|
|
@ -1,2 +0,0 @@
|
|||
$string = Read-Host "Input a string"
|
||||
[int]$number = Read-Host "Input a number"
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
REBOL [
|
||||
Title: "Textual User Input"
|
||||
URL: http://rosettacode.org/wiki/User_Input_-_text
|
||||
]
|
||||
|
||||
s: n: ""
|
||||
|
||||
; Because I have several things to check for, I've made a function to
|
||||
; handle it. Note the question mark in the function name, this convention
|
||||
; is often used in Forth to indicate test of some sort.
|
||||
|
||||
valid?: func [s n][
|
||||
error? try [n: to-integer n] ; Ignore error if conversion fails.
|
||||
all [0 < length? s 75000 = n]]
|
||||
|
||||
; I don't want to give up until I've gotten something useful, so I
|
||||
; loop until the user enters valid data.
|
||||
|
||||
while [not valid? s n][
|
||||
print "Please enter a string, and the number 75000:"
|
||||
s: ask "string: "
|
||||
n: ask "number: "
|
||||
]
|
||||
|
||||
; It always pays to be polite...
|
||||
|
||||
print rejoin [ "Thank you. Your string was '" s "'."]
|
||||
|
|
@ -2,7 +2,7 @@ import os
|
|||
import strconv
|
||||
|
||||
fn main() {
|
||||
s := strconv.atoi(os.input('Enter string')) ?
|
||||
s := strconv.atoi(os.input('Enter string')) !
|
||||
if s == 75000 {
|
||||
println('good')
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue