- 最後登錄
- 2024-5-16
- 在線時間
- 1558 小時
- 註冊時間
- 2010-8-8
- 閱讀權限
- 30
- 精華
- 0
- UID
- 8564223
- 帖子
- 479
- 積分
- 1763 點
- 潛水值
- 32172 米
| 如果你忘記伊莉的密碼,請在登入時按右邊出現的 '找回密碼'。輸入相關資料後送出,系統就會把密碼寄到你的E-Mail。 本帖最後由 tony01111299 於 2011-4-28 12:09 AM 編輯
拿上面那位仁兄的改一改:- #include <stdio.h>
- #define P printf
- int main()
- {
- P("\n"
- "<<< BGW PL-C Lab. Exercise #3 print-ascii Version 1.00A >>>\n"
- " (c) Bian Guo-Wei, HFU, 2007\n"
- " Function : to print the ASCII table (32-127)\n"
- "\n");
- for(int i=32;i<=127;++i)
- P("%3d(%c)%s",i,i,(i%10)?" ":"\n");
- P("\n");
- P("Press any key to continue");
- getchar();
- return 0;
- }
複製代碼 以下是另一種版本(純粹印出版):- #include <stdio.h>
- #define P printf
- int main()
- {
- P(""
- "<<< BGW PL-C Lab. Exercise #3 print-ascii Version 1.00A >>>\n"
- " (c) Bian Guo-Wei, HFU, 2007\n"
- " Function : to print the ASCII table (32-127)\n"
- "\n"
- " 32( ) 33(!) 34(\") 35(#) 36($) 37(%) 38(&) 39(') 40(()\n"
- " 41()) 42(*) 43(+) 44(,) 45(-) 46(.) 47(/) 48(0) 49(1) 50(2)\n"
- " 51(3) 52(4) 53(5) 54(6) 55(7) 56(8) 57(9) 58(:) 59(;) 60(<)\n"
- " 61(=) 62(>) 63(?) 64(@) 65(A) 66(B) 67(C) 68(D) 69(E) 70(F)\n"
- " 71(G) 72(H) 73(I) 74(J) 75(K) 76(L) 77(M) 78(N) 79(O) 80(P)\n"
- " 81(Q) 82(R) 83(S) 84(T) 85(U) 86(V) 87(W) 88(X) 89(Y) 90(Z)\n"
- " 91([) 92(\\) 93(]) 94(^) 95(_) 96(`) 97(a) 98(b) 99(c) 100(d)\n"
- "101(e) 102(f) 103(g) 104(h) 105(i) 106(j) 107(k) 108(l) 109(m) 110(n)\n"
- "111(o) 112(p) 113(q) 114(r) 115(s) 116(t) 117(u) 118(v) 119(w) 120(x)\n"
- "121(y) 122(z) 123({) 124(|) 125(}) 126(~) 127()\n"
- "Press any key to continue\n");
- getchar();
- return 0;
- }
複製代碼 ... |
|