Originally posted by zw19750516 at 2008-7-13 10:14 AM:
Old-fashioned, this set is based on the situation. For example, if you want to be symmetrical with numbers and letters, then set str=numbers+letters. If you want to be symmetrical with numbers and Chinese characters, then set str=numbers+Chinese characters. If the symmetrical relationship is irregular, then set it as terse brother did.
My understanding of your question is that symmetry has nothing to do with numbers and letters.
As long as you find the input value, it will be displayed at that position, and then displayed at the symmetrical position of that position. Both numbers and letters can be in random order.
So I am very confused about your problem-solving ideas.
For example, the following is random and repeated, (there are 2 zeros), it can also be displayed correctly.
But I currently can't solve the problem of spaces in the original characters. Spaces can be entered.
@echo off
set/p input=Please enter:
set "string=012t457689aycd0fghi3"
set num=
:pro1
set /a num+=1
set strtmp=%string:~0,1%%string:~-1%
set str%num%=##
rem The following sentence is an application of findstr class
echo %input%|findstr >nul&&set str%num%=%strtmp%
set string=%string:~1,-1%
if not defined string goto pro2
goto pro1
:pro2
setlocal enabledelayedexpansion
set str_1=x
for /l %%i in (1,1,%num%) do call set str_1=!str_1:~0,-1!%%str%%i%%
for /l %%i in (1,1,%num%) do call set str_2=%%str%%i%%!str_2:~1!
echo %str_1:~,-1% ^| %str_2:~1,-2%
pause
[
Last edited by quya on 2008-7-13 at 10:35 AM ]
我怎么找不到一个比我注册日期早的人? 难道我是传说中的超级管理员? 其实我只是个潜水冠军而已.