![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-11-24 13:58 |
47,820 topics / 349,938 posts / today 0 new / 48,298 members |
| DOS批处理 & 脚本技术(批处理室) » Symmetric output bonus question (challenging) |
| Printable Version 5,732 / 64 |
| Floor16 bat-zw | Posted 2008-07-11 01:46 |
| 金牌会员 Posts 1,276 Credits 3,105 | |
|
Wow. . .
ps: Brother's code is not universal. What if both sides are letters or Chinese characters? [ Last edited by zw19750516 on 2008-7-11 at 01:49 AM ] |
|
| Floor17 pusofalse | Posted 2008-07-11 01:52 |
| 银牌会员 Posts 646 Credits 1,604 | |
Originally posted by zw19750516 at 2008-7-11 01:46 AM: Please give more advice!~ |
|
| Floor18 bat-zw | Posted 2008-07-11 01:55 |
| 金牌会员 Posts 1,276 Credits 3,105 | |
|
Tips: intercept characters from both sides at the same time with the middle as the boundary
|
|
| Floor19 26933062 | Posted 2008-07-11 01:57 |
| 银牌会员 Posts 879 Credits 2,268 | |
Originally posted by zw19750516 at 2008-7-11 01:46: Both sides are letters? This can only be blamed on your carelessness in setting the question. |
|
| Floor20 pusofalse | Posted 2008-07-11 02:01 |
| 银牌会员 Posts 646 Credits 1,604 | |
|
It really is that I thought too, too complicated... I wanted to give up halfway through this problem, FAITH... Now if I do it again, I'm afraid I'll really give up. Such a problem makes my spine hurt when I think about it~
|
|
| Floor21 bat-zw | Posted 2008-07-11 02:02 |
| 金牌会员 Posts 1,276 Credits 3,105 | |
Originally posted by 26933062 at 2008-7-11 01:57: I just explained that the code should improve generality, and there's no other meaning. For this question, he has already solved it, and I don't deny that. |
|
| Floor22 bat-zw | Posted 2008-07-11 02:04 |
| 金牌会员 Posts 1,276 Credits 3,105 | |
Originally posted by pusofalse at 2008-7-11 02:01: Victory often follows right after the moment when you feel you can't hold on any longer. ps: Brothers, I'm going to sleep first. I have to go to work tomorrow. Looking forward to someone writing efficient and general-purpose code (mine won't be posted first)... [ Last edited by zw19750516 on 2008-7-11 at 02:08 AM ] |
|
| Floor23 terse | Posted 2008-07-11 02:46 |
| 银牌会员 Posts 946 Credits 2,404 | |
|
I think it's not that long. Sign in
|
|
| Floor24 bat-zw | Posted 2008-07-11 10:02 |
| 金牌会员 Posts 1,276 Credits 3,105 | |
|
But the code for solving the problem must not be short. I think it should not be solvable within 10 lines.
|
|
| Floor25 bat-zw | Posted 2008-07-11 11:49 |
| 金牌会员 Posts 1,276 Credits 3,105 | |
|
It seems that this problem is indeed a bit difficult. I'll first公布 my thought - out relatively complex method:
|
|
| Floor26 26933062 | Posted 2008-07-11 12:11 |
| 银牌会员 Posts 879 Credits 2,268 | |
|
It's really confusing. It took me quite a while...
There are three methods thought out in total. The first one is not universal, and the latter two are relatively universal. Generally speaking, I feel that the idea is not as clear as zw19750516's... I'm confused. Got bamboozled... Code One: The left side must be a number. (Not universal, only for the topic in the first post) Code Two: More universal, not limited to numbers, both left and right sides can be any characters but no duplicates. Code Three: |
|
| Floor27 bat-zw | Posted 2008-07-11 12:15 |
| 金牌会员 Posts 1,276 Credits 3,105 | |
|
To be honest, I'm confused by your code... The expert actually came up with three methods.
The idea highlights that this lies in the clever use of variable assignment. The flaw I think is still in the complexity of the code. [ Last edited by zw19750516 on 2008-7-11 at 01:02 PM ] |
|
| Floor28 bat-zw | Posted 2008-07-11 12:21 |
| 金牌会员 Posts 1,276 Credits 3,105 | |
|
Here is another code I used a bit cleverly (when inputting, it must be in the form like 1 a f 4):
|
|
| Floor29 pusofalse | Posted 2008-07-11 13:09 |
| 银牌会员 Posts 646 Credits 1,604 | |
|
After seeing the codes of seniors, I feel extremely ashamed...
|
|
| Floor30 26933062 | Posted 2008-07-11 15:18 |
| 银牌会员 Posts 879 Credits 2,268 | |
|
Another one, with a clear train of thought.
[ Last edited by 26933062 on 2008-7-11 at 04:14 PM ] |
|
| Prev 1 2 3 4 5 Next |
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |