swap adjacent bits

Submit

Your name:
File:
Open code-statistics:

Language is selected by the extension of the file. See the list of supported languages to know the extension of your language.

Problem

Given a number, swap adjacent bits:

For example, 6 -> 0110 ~~> 1001 -> 9

Print the swapped number from 0 to 99 inclusive.

Options

exec is denied

rejudge feature is enabled

now post-mortem time, all source codes will be revealed

Sample input:_

*NOTHING*

Sample output:

0
2
1
3
8
10
9
11
4
6
5
7
12
14
13
15
32
34
33
35
40
42
41
43
36
38
37
39
44
46
45
47
16
18
17
19
24
26
25
27
20
22
21
23
28
30
29
31
48
50
49
51
56
58
57
59
52
54
53
55
60
62
61
63
128
130
129
131
136
138
137
139
132
134
133
135
140
142
141
143
160
162
161
163
168
170
169
171
164
166
165
167
172
174
173
175
144
146
145
147

Ranking

Ruby _

RankUserSizeTimeDateStatistics
1teebee280.02172024/06/07 08:29:370B / 14B / 13B
2Dingledooper280.02052024/06/07 08:41:220B / 14B / 13B
3tails280.02022024/06/07 09:35:030B / 14B / 13B
4fuzzylojik280.02012024/06/07 11:31:450B / 14B / 13B
5rotary-o280.01992024/06/07 12:13:490B / 16B / 12B

Ruby2 _

RankUserSizeTimeDateStatistics
1Dingledooper290.07292024/06/07 06:21:360B / 16B / 12B
2teebee290.06022024/06/07 08:31:100B / 16B / 12B
3tails290.05932024/06/07 09:34:260B / 16B / 12B
4fuzzylojik290.06212024/06/07 11:31:530B / 16B / 12B
5rotary-o290.06262024/06/07 12:13:370B / 18B / 11B
6Hendrik290.06032024/06/08 04:49:380B / 18B / 11B
7Andriamanitra320.06302024/06/06 20:08:050B / ?B / ?B

Perl _

RankUserSizeTimeDateStatistics
1tails320.01492024/06/06 16:05:470B / 15B / 16B
2Dingledooper320.01912024/06/07 06:22:360B / 15B / 16B
3teebee320.01532024/06/07 08:13:580B / 15B / 16B
4fuzzylojik320.01472024/06/07 11:29:460B / 15B / 17B

Python _

RankUserSizeTimeDateStatistics
1teebee380.02982024/06/07 09:49:210B / 25B / 10B
2fuzzylojik380.03072024/06/07 11:25:250B / 25B / 10B
3xnor (alt)380.03142024/06/07 16:41:520B / 22B / 15B
4test390.10372024/06/08 04:45:080B / 27B / 9B

Python3 _

RankUserSizeTimeDateStatistics
1orthoplex400.15472024/06/06 14:41:110B / 25B / 12B
2xnor400.04602024/06/06 15:31:320B / 25B / 12B
3ovs400.04562024/06/06 20:13:450B / 25B / 12B
4Dingledooper400.04792024/06/07 06:08:570B / 25B / 12B
5teebee400.06932024/06/07 08:52:350B / 25B / 12B
6fuzzylojik400.04582024/06/07 11:24:470B / 25B / 12B

PHP _

RankUserSizeTimeDateStatistics
1teebee400.06232024/06/08 05:46:511B / 17B / 22B
2fuzzylojik400.02902024/06/14 20:18:581B / 17B / 22B

Pike _

RankUserSizeTimeDateStatistics
1teebee580.09802024/06/08 06:10:390B / 30B / 26B

Scheme _

RankUserSizeTimeDateStatistics
1teebee470.03762024/06/08 17:05:290B / 25B / 20B

Common LISP _

RankUserSizeTimeDateStatistics
1teebee560.01882024/06/14 15:25:570B / 31B / 20B

Io _

RankUserSizeTimeDateStatistics
1teebee340.05932024/06/08 07:27:250B / 20B / 14B

JavaScript _

RankUserSizeTimeDateStatistics
1Dingledooper370.02232024/06/07 06:20:330B / 20B / 17B
2teebee370.02242024/06/07 08:20:270B / 20B / 17B
3fuzzylojik370.02302024/06/07 11:28:020B / 20B / 17B
4Hendrik380.02192024/06/07 05:35:380B / 23B / 15B
5Andriamanitra410.02172024/06/06 20:12:010B / ?B / ?B
6KrausRaus1060.02402024/06/06 19:48:170B / 62B / 43B

Tcl _

RankUserSizeTimeDateStatistics
1teebee480.02322024/06/11 07:20:150B / 27B / 16B

Xtal _

RankUserSizeTimeDateStatistics
1teebee300.04712024/06/08 05:55:470B / 17B / 12B

SNOBOL _

RankUserSizeTimeDateStatistics
1teebee740.01622024/06/11 06:51:180B / 29B / 25B

Icon _

RankUserSizeTimeDateStatistics
1teebee600.01722024/06/08 07:33:480B / 41B / 16B

REXX _

RankUserSizeTimeDateStatistics
1teebee490.01812024/06/14 05:43:330B / 31B / 15B

PARI/GP _

RankUserSizeTimeDateStatistics
1teebee390.07682024/06/07 10:08:320B / 24B / 15B

Prolog _

RankUserSizeTimeDateStatistics
1teebee510.02422024/06/09 03:59:530B / 25B / 25B

BASIC _

RankUserSizeTimeDateStatistics
1teebee340.01742024/06/08 05:18:330B / 22B / 10B

Perl6 _

RankUserSizeTimeDateStatistics
1teebee300.41272024/06/08 05:31:540B / 13B / 14B
2tails (teebee)280.42392024/06/20 16:35:000B / 13B / 12B

K _

RankUserSizeTimeDateStatistics
1teebee310.00962024/06/12 04:57:520B / 13B / 17B

Atlas _

RankUserSizeTimeDateStatistics
1tails140.14012024/06/06 18:01:300B / 6B / 8B

C _

RankUserSizeTimeDateStatistics
1tails520.01342024/06/07 09:23:180B / 25B / 27B
2teebee520.01402024/06/07 09:43:000B / 25B / 27B
3fuzzylojik530.01392024/06/07 11:26:250B / 26B / 27B
4rotary-o530.01352024/06/08 00:28:230B / 30B / 23B
5McBusLuck540.01362024/06/09 18:49:010B / 29B / 25B
6AH550.01372024/06/07 02:10:140B / ?B / ?B
7_590.01502024/06/06 23:41:360B / ?B / ?B

Java _

RankUserSizeTimeDateStatistics
1teebee660.20562024/06/07 08:26:230B / 39B / 25B
2rotary-o670.06042024/06/07 12:15:370B / 42B / 23B

C# _

RankUserSizeTimeDateStatistics
1teebee900.04392024/06/07 08:48:030B / 60B / 26B
2fuzzylojik900.03562024/06/07 11:29:010B / 60B / 26B
3rotary-o910.04392024/06/07 12:15:500B / 63B / 24B
4AH920.04552024/06/07 02:17:510B / 62B / 26B

Maxima _

RankUserSizeTimeDateStatistics
1teebee450.06792024/06/08 07:47:270B / 28B / 17B

REBOL _

RankUserSizeTimeDateStatistics
1teebee470.02892024/06/09 03:53:040B / 27B / 11B

Asymptote _

RankUserSizeTimeDateStatistics
1teebee630.07922024/06/09 05:07:330B / 32B / 30B

AWK _

RankUserSizeTimeDateStatistics
1teebee460.01972024/06/08 00:20:090B / 25B / 21B
2tails (teebee)430.01452024/06/20 12:08:350B / 24B / 19B

sed _

RankUserSizeTimeDateStatistics
1tails1110.01932024/06/07 16:01:130B / 39B / 59B

Bash (builtins) _

RankUserSizeTimeDateStatistics
1teebee330.02142024/06/09 23:45:060B / 12B / 18B
2tails330.02212024/06/14 09:40:570B / 12B / 18B
3McBusLuck340.02292024/06/09 18:43:080B / 15B / 16B

make _

RankUserSizeTimeDateStatistics
1tails1580.01902024/06/07 11:51:350B / 82B / 60B

bc _

RankUserSizeTimeDateStatistics
1teebee430.00742024/06/08 00:23:260B / 19B / 23B
2McBusLuck640.02182024/06/09 21:29:030B / 31B / 31B

dc _

RankUserSizeTimeDateStatistics
1tails350.00862024/06/07 09:31:470B / 23B / 12B

xgawk _

RankUserSizeTimeDateStatistics
1teebee410.01552024/06/09 05:32:270B / 24B / 17B

m4 _

RankUserSizeTimeDateStatistics
1tails640.01442024/06/07 10:04:270B / 34B / 29B

GolfScript _

RankUserSizeTimeDateStatistics
1tails160.04182024/06/06 18:05:270B / 6B / 10B
2ovs160.03742024/06/07 00:25:450B / 6B / 10B
3orthoplex160.04792024/06/07 05:44:450B / 6B / 10B

gs2 _

RankUserSizeTimeDateStatistics
1tails110.23202024/06/06 14:07:565B / 5B / 1B

Nibbles _

RankUserSizeTimeDateStatistics
1tails90.01902024/06/06 14:29:076B / 1B / 2B

Burlesque _

RankUserSizeTimeDateStatistics
1Hendrik240.02092024/06/07 05:09:040B / 13B / 11B
2Hendrik190.02052024/06/21 01:45:210B / 10B / 9B

Lazy-K _

RankUserSizeTimeDateStatistics
1tails7910.06652024/06/06 16:59:410B / 436B / 355B

Universal Lambda _

RankUserSizeTimeDateStatistics
1tails670.02192024/06/06 17:40:0552B / 7B / 6B

goruby _

RankUserSizeTimeDateStatistics
1teebee250.02962024/06/07 23:42:110B / 12B / 12B
2fuzzylojik260.02882024/06/07 11:32:330B / 13B / 12B

Groovy _

RankUserSizeTimeDateStatistics
1teebee340.73242024/06/07 10:03:250B / 23B / 10B

Scala _

RankUserSizeTimeDateStatistics
1teebee372.32652024/06/07 08:43:310B / 21B / 15B
2Hendrik382.14442024/06/07 04:43:550B / 25B / 11B
3rotary-o382.48992024/06/07 12:15:110B / 25B / 11B
4test462.19352024/06/07 04:20:530B / 25B / 19B

Logo _

RankUserSizeTimeDateStatistics
1teebee370.01712024/06/08 01:01:270B / 24B / 9B

Language Ranking_

RankLangUserSizeScore
1Nibblestails910000
2gs2tails118181
3Atlastails146428
4GolfScripttails165625
5BurlesqueHendrik194736
6gorubyteebee253600
7Rubyteebee283214
8Perl6tails (teebee)283214
9Ruby2Dingledooper293103
10Xtalteebee303000
11Kteebee312903
12Perltails322812
13Bash (builtins)teebee332727
14Groovyteebee342647
15BASICteebee342647
16Ioteebee342647
17dctails352571
18JavaScriptDingledooper372432
19Scalateebee372432
20Logoteebee372432
21Pythonteebee382368
22PARI/GPteebee392307
23Python3orthoplex402250
24PHPteebee402250
25xgawkteebee412195
26bcteebee432093
27AWKtails (teebee)432093
28Maximateebee452000
29Schemeteebee471914
30REBOLteebee471914
31Tclteebee481875
32REXXteebee491836
33Prologteebee511764
34Ctails521730
35Common LISPteebee561607
36Piketeebee581551
37Iconteebee601500
38Asymptoteteebee631428
39m4tails641406
40Javateebee661363
41Universal Lambdatails671343
42SNOBOLteebee741216
43C#teebee901000
44sedtails111810
45maketails158569
46Lazy-Ktails791113

return to the top page