--- tags: DICE C --- 2-5 來個表格 === > [name=CHAWTeam] [time=Feb 15, 2022] --- 目錄:[DICE C語言程式破解](https://hackmd.io/@CHAWTeam/DiceC) 上一篇:[2-4 不是計算](https://hackmd.io/@CHAWTeam/DiceC-2-4) 下一篇:[2_1 倒印三角形](https://hackmd.io/@CHAWTeam/DiceC-2_1) --- 題目 --- ```! 寫一個程式,印出如下的資料,同行的資料間以\t間隔: 輸出範例: 1 1 1 2 4 8 3 9 27 4 16 64 5 25 125 6 36 216 7 49 343 8 64 512 9 81 729 10 100 1000 ``` 程式碼 --- ### 範例1 ```cpp= #include <stdio.h> int main() { printf("1\t1\t1\n2\t4\t8\n3\t9\t27\n4\t16\t64\n5\t25\t125\n6\t36\t216\n7\t49\t343\n8\t64\t512\n9\t81\t729\n10\t100\t1000"); //「\t」即為 tab 鍵縮排 return 0; } ``` ### 範例2 ```c= #include <stdio.h> int main() { printf("1\t1\t1\n"); //「\t」即為 tab 鍵縮排 printf("2\t4\t8\n"); printf("3\t9\t27\n"); printf("4\t16\t64\n"); printf("5\t25\t125\n"); printf("6\t36\t216\n"); printf("7\t49\t343\n"); printf("8\t64\t512\n"); printf("9\t81\t729\n"); printf("10\t100\t1000\n"); return 0; } ``` 輸出 --- ```! 1 1 1 2 4 8 3 9 27 4 16 64 5 25 125 6 36 216 7 49 343 8 64 512 9 81 729 10 100 1000 ``` --- [查看我們在HackMD上的所有筆記](https://hackmd.io/@CHAWTeam) 目錄:[DICE C語言程式破解](https://hackmd.io/@CHAWTeam/DiceC) 上一篇:[2-4 不是計算](https://hackmd.io/@CHAWTeam/DiceC-2-4) 下一篇:[2_1 倒印三角形](https://hackmd.io/@CHAWTeam/DiceC-2_1) --- {%hackmd Iiu5mOixR7yWkPHKCkabBg %} <iframe class="LikeCoin" height="235" src="https://button.like.co/in/embed/chawteam/button?referrer=https://hackmd.io/@CHAWTeam/DiceC-2-5" width="100%"></iframe> --- {%hackmd i1nMRrZcTFmTvoF897K9zg %}
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up