T: :
T 20 2016 13:51 17 2016 02:32 |
, .
ABCD, DCBA. : 1234 - 4321 5678 - 8765 123 - 3210 5610 - 0165 (, , VBA. - VBA) Text Sub () ' Dim x As Integer, a As Single, b As Single, c As Single, d As Single ' x = InputBox("x=") Do While x > 9999 Or x < 0 x = InputBox(" , ") Loop ' a = x \ 1000 b = (x - a * 1000) \ 100 c = (x - (a * 1000 + b * 100)) \ 10 d = (x - (a * 1000 + b * 100 + c * 10)) ' 'MsgBox x ' ' MsgBox (" = " & x & vbNewLine & " = " & d & c & b & a) ' 'cells(2,2)= d & c & b & a End Sub |
T 20 2016 13:52 |
, - , , Dim x As Integer .. , , . . |
T 20 2016 13:54 |
: . .. - : 123,5 - 5,321 45,87 - 78,54 1,052 - 250,1 0,05 - 50 23,564489236 - 65,23 4,93251872 - 339,4 , . . , , , . |
T 20 2016 15:24 |
0 10000 (.. ) 1 x ", " y=ABCD 1.1. x<1000 or x=100 y=x*100\10 1.2. x<100 or x=10 y=x*1000\10 1.3. x<10 or x=1 y=x*10000\10 1,4, x<1 y=x*100000\10 1.5. y=x*10\10 2. y , , z=DCBA 3. z , q, 3.1. x<1000 or x=100 q=y/1000 3.2. x<100 or x=10 q=y/100 3.3. x<10 or x=1 q=y/10 3.4. 3.5. q=y q ------ - . , |
T 20 2016 15:41 |
, ABCD DCBA ( ), 0,DCBA |
T 20 2016 15:58 |
o! y Integer, ( , ) |
T 20 2016 16:08 20 2016 16:10 |
, ,
z=d*1000+c*100+b*10+a z , . , z , |
T 20 2016 17:15 |
o! y Integer, . . / , \ |
T 20 2016 18:45 |
- . Text (Unknown Language) Sub perevertish() ' 'ABCD => DCBA '============================================================================== '0. . , '0.1. , ( ) Dim x As Single '0.2. , . ' - x Dim y As Integer '0.3. . Dim a As Integer, b As Integer, c As Integer, d As Integer '0.4. -, ' y . Dim z As Integer '0.5. , ( z) Dim q As Single '============================================================================== '1. x = InputBox(" 10`000, x=") '2. , ' ' , .. ' type mismatch ( ) Do While x < 0 Or x >= 10000 x = InputBox(" , ") Loop ' 'MsgBox x '============================================================================== '3. ABCD, If x < 1000 And x >= 100 Then y = x * 100 \ 10 Else If x < 100 And x >= 10 Then y = x * 1000 \ 10 Else If x < 10 And x >= 1 Then y = x * 10000 \ 10 Else If x < 1 Then y = x * 100000 \ 10 Else: y = x * 10 \ 10 End If End If End If End If ' 'MsgBox y '============================================================================== '4. a = y \ 1000 b = (y - a * 1000) \ 100 c = (y - (a * 1000 + b * 100)) \ 10 d = (y - (a * 1000 + b * 100 + c * 10)) '============================================================================== '5. - z = d * 1000 + c * 100 + b * 10 + a '============================================================================== '6. , "" If x < 1000 And x >= 100 Then q = z / 1000 Else If x < 100 And x >= 10 Then q = z / 100 Else If x < 10 And x >= 1 Then q = z / 10 Else If x < 1 Then q = z Else: q = z / 10000 End If End If End If End If '============================================================================== '7. '7.1. MsgBox (" = " & x & vbNewLine & " = " & q) ' 'cells(2,2)=q End Sub |
T 20 2016 18:57 |
-
, , 9999,9999 |
MoRS 23 2016 12:02 |
PHP array_reverse(), VBA , .. . .. |
MoRS 23 2016 12:06 23 2016 12:18 |
. , .. |
T 23 2016 12:59 |
! . , StrReverse() . , , . ( ) |
MoRS 25 2016 01:15 |
. Ҹ |
T 04 2016 08:43 |
Text (Unknown Language) Sub perevertish02() Dim x As Double, q As Double x = InputBox("x=") q = CDbl(StrReverse(CStr(x))) MsgBox (" = " & x & vbNewLine & " = " & q) End Sub : , , .. - |
T 04 2016 08:56 04 2016 09:23 |
.
|
T 04 2016 09:52 |
(, , ) Text (Unknown Language) Sub perevertish02() Dim x As Double, q As Double x = Application.InputBox("x=", Type:=1) q = CDbl(StrReverse(CStr(x))) MsgBox (" = " & x & vbNewLine & " = " & q) End Sub |
T 04 2016 09:57 04 2016 10:00 |
(, , ) , . , , Method or data member not found (Error 461) Application.InputBox - type mismatch , . |
T 07 2016 05:34 07 2016 05:36 |
, ,
Text Sub perevertish03()
Dim x As Double x = Application.InputBox("x=", Type:=1) MsgBox (" = " & x & vbNewLine & " = " & CDbl(StrReverse(CStr(x)))) End Sub |
T 12 2016 18:20 |
, CDbl , .. - . , - , . |
> 1