當前位置:首頁 » 編程語言 » c語言的for九九乘法表

c語言的for九九乘法表

發布時間: 2025-06-06 07:04:48

① 用c語言怎麼輸出九九乘法表呀

#include <stdio.h>
void main()
{
int i,j;

for(i=1;i<=9;i++)
{
for(j=1;j<=9;j++)
printf("%d*%d=%-3d ",i,j,i*j);
printf("\n");
}
}

輸出:
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
3*1=3 3*2=6 3*3=9 3*4=12 3*5=15 3*6=18 3*7=21 3*8=24 3*9=27
4*1=4 4*2=8 4*3=12 4*4=16 4*5=20 4*6=24 4*7=28 4*8=32 4*9=36
5*1=5 5*2=10 5*3=15 5*4=20 5*5=25 5*6=30 5*7=35 5*8=40 5*9=45
6*1=6 6*2=12 6*3=18 6*4=24 6*5=30 6*6=36 6*7=42 6*8=48 6*9=54
7*1=7 7*2=14 7*3=21 7*4=28 7*5=35 7*6=42 7*7=49 7*8=56 7*9=63
8*1=8 8*2=16 8*3=24 8*4=32 8*5=40 8*6=48 8*7=56 8*8=64 8*9=72
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>
main()
{
inti,j;
for(i=1;i<=9;i++)//循環計算1~9
{
for(j=1;j<=i;j++)//輸出數i的i個乘法項
{
printf("%d*%d=%d",i,j,i*j);
}
if(i==3)printf(" Thisisthe9*9table.");//在3的那一行輸出Thisisthe9*9table.
printf(" ");//輸出換行符
}
}

③ C語言中,輸出九九乘法表

#include<stdio.h>

intmain()
{
inti=0,j=0;
for(i=1;i<=9;i++)
{
for(j=1;j<=i;j++)
{
printf("%dx%d=%d",j,i,i*j);
}
printf(" ");
}
return0;
}
1x1=1
1x2=22x2=4
1x3=32x3=63x3=9
1x4=42x4=83x4=124x4=16
1x5=52x5=103x5=154x5=205x5=25
1x6=62x6=123x6=184x6=245x6=306x6=36
1x7=72x7=143x7=214x7=285x7=356x7=427x7=49
1x8=82x8=163x8=244x8=325x8=406x8=487x8=568x8=64
1x9=92x9=183x9=274x9=365x9=456x9=547x9=638x9=729x9=81
Pressanykeytocontinue

熱點內容
c語言中讀取行 發布:2025-06-07 03:48:17 瀏覽:476
蘋果文件里的音樂怎麼傳到安卓 發布:2025-06-07 03:30:21 瀏覽:333
蘋果的藍牙耳機為什麼連接不上安卓手機 發布:2025-06-07 03:30:18 瀏覽:525
php字元替換正則 發布:2025-06-07 03:29:35 瀏覽:917
ibm伺服器怎麼做raid0 發布:2025-06-07 03:26:27 瀏覽:300
c語言求階乘的函數 發布:2025-06-07 03:00:56 瀏覽:639
fastcgiphpfpm 發布:2025-06-07 02:50:12 瀏覽:775
伺服器收集ip加埠 發布:2025-06-07 02:28:03 瀏覽:957
如何清除安卓手機上的cookie 發布:2025-06-07 02:26:18 瀏覽:586
linux虛擬機win7 發布:2025-06-07 02:09:04 瀏覽:147