Home > database >  To do a problem
To do a problem

Time:11-20

5. Programming: input from the keyboard a three digits of the positive integer, then reverse the output the number, enter 123, for example, the output 321, 300 as input, the output 003, thinking: if required to enter 300, the output is 3, how to modify a program?

Turn to for help

CodePudding user response:

1. What language do you use?
300, 2. The input and output from right to left, if the output is 3, should be the problem of data types, consider using a string type, do not use int, decimal, double, money,

CodePudding user response:

Access to keyboard input, to obtain the value of the horse and then converted to int output

CodePudding user response:

 

- junction post


DECLARE @ STR varchar (2000)
The SET @ STR='123'
The SET @ STR=REVERSE (@ STR)
SELECT the Cast (@ STR As Int)

  • Related