|
C語言程式碼美化效果演示 |
|
|
|
|
|
SourceFormatX 使用強大的C詞法解析引擎全面地分析您的程式碼並根據用戶自定義的C語言程式碼風格重構和美化C程式碼檔案,因此它能精細地根據不同的程式碼風格美化多種程式碼,甚至是下面這些極度混亂的程式碼:
|
C/C++程式碼美化範例:
範例1
|
範例2
|
範例3
|
範例4
|
範例5
這段C語言程式碼同樣也來自于 IOCCC,程式碼被排列成一個巨型的"分號"。這份混亂的C程式碼檔案在1秒種內即被 SourceFormatX C 程式碼美化工具 美化和縮排成整潔且可讀性強的美觀風格樣式。
static signed char a[] = {0x69,
110, 118, 97, 108, 105, 0x64, 1-1,
0x6d, 111, 118, 101, 1<<1<<1<<1<<1<<1,
114, 105, 0x6e, 103, 32, 'o'/3, 100,
32, 102, 114, 111, 0x6d, 32, 115, 116,
97, 100-001, 107, 32,37, 2*'2', '@'>>1,
116, '%' + '%' + '%','w'-'W',115, 0x74,
97, 3*'!', 107, 'q' - 'Q', 37, 10*'\n',
10, 0}, * b = a + (1<<1<<1<<1), * w, x,
*q, c, r; int main(int d, char *e []) {
return q = (signed char *)(e+1+1), (r =
e[0] && e[1] ? 0 : 0 * puts (a) + 1) ||
(r = e[1<<1] && d != 1 <<1 && 0 * puts(
a) + 1) || e[1- -1] || (r = atoi(e[1])
< -0200 || atoi (e [1]) > 0x7f || ( x =
atoi( e[1] ) ) == 0 ? 0 * puts(a) + 1 :
0) || e [1- -1] || (x- -x > 1-1 ? (q[0]
= x, q[1] = q[3] = 1, q[2] = 2) : (
memset ( w = ( signed char * )
malloc(-x), '1', -x), puts (w),
q[0] = x, q[1] = '0', q[2] = q[3] =
0)), r || (q[3] ? (c = 6 - q[1] - q[2],
(q[0] != 1) ? q[0]-- , d = q[2], q[2] =
c, main(2, e), c = q[2], q[2] = d, q[0]
++ : 0, printf(b, q[0], q[1], q[2]), (q
[0] != 1) ? q[0]--, d = q[1],q[1] = c ,
main(2, e), c = q[1], q[1] = d, q[0] ++
: 0) : - 1 - q[0] - 1 == 0 ? (w[- x - 1
- (q[1] & 1 ^ 1)] = q[1], puts (w), w [
- x - 1 - (q[1] & 1)] = q[1], puts(w) )
: - 1 - q[0] == 0 ? (w[- x - 1] = q[ 1
], puts(w)) : (q[0] += 1 + ( q[1] & 1
^ 1), main(2, e), q[0] -= 1 + ( q
[1] & 1 ^ 1), q[1] & 1 ? (q
[0]+=1+1, q[1]^=1, main
(2, e), q[1]^=1, q[0]-=1
+1) : 0, w[q[0] - x] = q
[1], puts(w), q[1] & 1 ?
0 : (q[0]+=1+1, q[1]^=1,
main (2, e), q[1]^=1, q
[0]-=1+1), q[0] += 1 +
(q[1] & 1),main(2,e)
, q[0] -= 1 + (q[1]
& 1) ) ), r; }
static signed char a[] =
{
0x69, 110, 118, 97, 108, 105, 0x64, 1-1, 0x6d, 111, 118, 101, 1 << 1 << 1 <<
1 << 1 << 1, 114, 105, 0x6e, 103, 32, 'o' / 3, 100, 32, 102, 114, 111, 0x6d,
32, 115, 116, 97, 100-001, 107, 32, 37, 2 *'2', '@' >> 1, 116, '%' + '%' +
'%', 'w' - 'W', 115, 0x74, 97, 3 *'!', 107, 'q' - 'Q', 37, 10 *'\n', 10, 0
}, *b = a + (1 << 1 << 1 << 1), *w, x, *q, c, r;
int main(int d, char *e[])
{
return q = (signed char*)(e + 1 + 1), (r = e[0] && e[1] ? 0 : 0 *puts(a) + 1)
|| (r = e[1 << 1] && d != 1 << 1 && 0 *puts(a) + 1) || e[1- -1] || (r = atoi
(e[1]) < - 0200 || atoi(e[1]) > 0x7f || (x = atoi(e[1])) == 0 ? 0 *puts(a)
+ 1 : 0) || e[1- -1] || (x - - x > 1-1 ? (q[0] = x, q[1] = q[3] = 1, q[2]
= 2) : (memset(w = (signed char*)malloc( -x), '1', -x), puts(w), q[0] = x,
q[1] = '0', q[2] = q[3] = 0)), r || (q[3] ? (c = 6-q[1] - q[2], (q[0] != 1)
? q[0]--, d = q[2], q[2] = c, main(2, e), c = q[2], q[2] = d, q[0]++ : 0,
printf(b, q[0], q[1], q[2]), (q[0] != 1) ? q[0]--, d = q[1], q[1] = c, main
(2, e), c = q[1], q[1] = d, q[0]++ : 0) : -1 - q[0] - 1 == 0 ? (w[-x - 1 -
(q[1] &1 ^ 1)] = q[1], puts(w), w[-x - 1-(q[1] &1)] = q[1], puts(w)) : -1 -
q[0] == 0 ? (w[ - x - 1] = q[1], puts(w)): (q[0] += 1+(q[1] &1 ^ 1), main
(2, e), q[0] -= 1+(q[1] &1 ^ 1), q[1] &1 ? (q[0] += 1+1, q[1] ^= 1, main(2,
e), q[1] ^= 1, q[0] -= 1+1): 0, w[q[0] - x] = q[1], puts(w), q[1] &1 ? 0 :
(q[0] += 1+1, q[1] ^= 1, main(2, e), q[1] ^= 1, q[0] -= 1+1), q[0] += 1+
(q[1] &1), main(2, e), q[0] -= 1+(q[1] &1))), r;
}
範例1
|
範例2
|
範例3
|
範例4
|
範例5
|