--- tags: DICE C --- 18-1 九九乘法 === > [name=CHAWTeam] 目錄:[DICE C語言程式破解](/@CHAWTeam/DiceC) 題目 --- ```! 寫一個程式, 使用巢狀迴圈,印出九九乘法表。 輸出範例: 1*1=1 1*2=2 1*3=3 1*4=4 1*5=5 1*6=6 1*7=7 1*8=8 1*9=9 2*1=2 2*2=4 2*3=6 2*4=8 2*5=10 2*6=12 2*7=14 2*8=16 2*9=18 . .(略,輸出時不依本題範例,而是以此類推。) . 9*1=9 9*2=18 9*3=27 9*4=36 9*5=45 9*6=54 9*7=63 9*8=72 9*9=81 c範例程式: #include <stdio.h> int main(){ int i,j; for(............){ for(............){ printf("%d*%d=%d\n",i,j,i*j); } } return 0; } c++範例程式: #include <iostream> int main() { int i,j; for(i=1;i<=9;i++){ for(j=1;j<=9;j++){ std::cout<<i<<"*"<<j<<"="<<i*j<<"\n"; } } return 0; } ``` 程式碼 --- ```c= #include <stdio.h> int main() { for (int i = 1; i <= 9; i++) { for (int j = 1; j <= 9; j++) printf("%d*%d=%d\n", i, j, i * j); } return 0; } ``` --- [查看我們在HackMD上的所有筆記](https://hackmd.io/@CHAWTeam) 目錄:[DICE C語言程式破解](https://hackmd.io/@CHAWTeam/DiceC) --- {%hackmd Iiu5mOixR7yWkPHKCkabBg %} <iframe class="LikeCoin" height="235" src="https://button.like.co/in/embed/chawteam/button?referrer=https://hackmd.io/@CHAWTeam/DiceC-18-1" width="100%"></iframe> --- {%hackmd i1nMRrZcTFmTvoF897K9zg %}