10進数/16進数/2進数の変換テーブル


※入力した数を他の基数(10進数/16進数/2進数とか)に数値表記変換するプログラム。
数値表記変換プログラム(CGI)

10進数 16進数2進数
0 000000000
1 100000001
2 200000010
3 300000011
4 400000100
5 500000101
6 600000110
7 700000111
8 800001000
9 900001001
10 a00001010
11 b00001011
12 c00001100
13 d00001101
14 e00001110
15 f00001111
16 1000010000
17 1100010001
18 1200010010
19 1300010011
20 1400010100
21 1500010101
22 1600010110
23 1700010111
24 1800011000
25 1900011001
26 1a00011010
27 1b00011011
28 1c00011100
29 1d00011101
30 1e00011110
31 1f00011111
32 2000100000
33 2100100001
34 2200100010
35 2300100011
36 2400100100
37 2500100101
38 2600100110
39 2700100111
40 2800101000
41 2900101001
42 2a00101010
43 2b00101011
44 2c00101100
45 2d00101101
46 2e00101110
47 2f00101111
48 3000110000
49 3100110001
50 3200110010
51 3300110011
52 3400110100
53 3500110101
54 3600110110
55 3700110111
56 3800111000
57 3900111001
58 3a00111010
59 3b00111011
60 3c00111100
61 3d00111101
62 3e00111110
63 3f00111111
64 4001000000
65 4101000001
66 4201000010
67 4301000011
68 4401000100
69 4501000101
70 4601000110
71 4701000111
72 4801001000
73 4901001001
74 4a01001010
75 4b01001011
76 4c01001100
77 4d01001101
78 4e01001110
79 4f01001111
80 5001010000
81 5101010001
82 5201010010
83 5301010011
84 5401010100
85 5501010101
86 5601010110
87 5701010111
88 5801011000
89 5901011001
90 5a01011010
91 5b01011011
92 5c01011100
93 5d01011101
94 5e01011110
95 5f01011111
96 6001100000
97 6101100001
98 6201100010
99 6301100011
100 6401100100
101 6501100101
102 6601100110
103 6701100111
104 6801101000
105 6901101001
106 6a01101010
107 6b01101011
108 6c01101100
109 6d01101101
110 6e01101110
111 6f01101111
112 7001110000
113 7101110001
114 7201110010
115 7301110011
116 7401110100
117 7501110101
118 7601110110
119 7701110111
120 7801111000
121 7901111001
122 7a01111010
123 7b01111011
124 7c01111100
125 7d01111101
126 7e01111110
127 7f01111111
128 8010000000
129 8110000001
130 8210000010
131 8310000011
132 8410000100
133 8510000101
134 8610000110
135 8710000111
136 8810001000
137 8910001001
138 8a10001010
139 8b10001011
140 8c10001100
141 8d10001101
142 8e10001110
143 8f10001111
144 9010010000
145 9110010001
146 9210010010
147 9310010011
148 9410010100
149 9510010101
150 9610010110
151 9710010111
152 9810011000
153 9910011001
154 9a10011010
155 9b10011011
156 9c10011100
157 9d10011101
158 9e10011110
159 9f10011111
160 a010100000
161 a110100001
162 a210100010
163 a310100011
164 a410100100
165 a510100101
166 a610100110
167 a710100111
168 a810101000
169 a910101001
170 aa10101010
171 ab10101011
172 ac10101100
173 ad10101101
174 ae10101110
175 af10101111
176 b010110000
177 b110110001
178 b210110010
179 b310110011
180 b410110100
181 b510110101
182 b610110110
183 b710110111
184 b810111000
185 b910111001
186 ba10111010
187 bb10111011
188 bc10111100
189 bd10111101
190 be10111110
191 bf10111111
192 c011000000
193 c111000001
194 c211000010
195 c311000011
196 c411000100
197 c511000101
198 c611000110
199 c711000111
200 c811001000
201 c911001001
202 ca11001010
203 cb11001011
204 cc11001100
205 cd11001101
206 ce11001110
207 cf11001111
208 d011010000
209 d111010001
210 d211010010
211 d311010011
212 d411010100
213 d511010101
214 d611010110
215 d711010111
216 d811011000
217 d911011001
218 da11011010
219 db11011011
220 dc11011100
221 dd11011101
222 de11011110
223 df11011111
224 e011100000
225 e111100001
226 e211100010
227 e311100011
228 e411100100
229 e511100101
230 e611100110
231 e711100111
232 e811101000
233 e911101001
234 ea11101010
235 eb11101011
236 ec11101100
237 ed11101101
238 ee11101110
239 ef11101111
240 f011110000
241 f111110001
242 f211110010
243 f311110011
244 f411110100
245 f511110101
246 f611110110
247 f711110111
248 f811111000
249 f911111001
250 fa11111010
251 fb11111011
252 fc11111100
253 fd11111101
254 fe11111110
255 ff11111111

[おまけ] HTML形式データ(文書?)の生成プログラム(^^;)
#include <stdio.h>

int
main(int argc, char *argv[])
{
  int i, j, k;
  char bin[9];

  printf("<TABLE BORDER>\n");
  bin[8] = '\0';
  for (i = 0; i < 256; i++) {
    for (j = 0, k = 0x80; j < 8; j++, k >> = 1) {
      bin[j] = (i & k) ? '1' : '0';
    }
    printf("<TR align=center><TD><code>%d</code></TD>\n");
    printf("<TD><code>%x</code></TD>");
    printf("<TD><code>%s</code></TD>\n</TR>\n\n", i, i, bin);
  }
  printf("</TABLE>\n");
  return 0;
}