當前位置:編程學習大全網 - 網站源碼 - c語言在屏幕上輸出下面的結果,輸出數據的行數通過鍵盤輸入,要求在5~20行之間。

c語言在屏幕上輸出下面的結果,輸出數據的行數通過鍵盤輸入,要求在5~20行之間。

代碼如下:

#include?<stdio.h>

int?main()

{

int?a,?n?=?3;

int?b[20][4]?=?{0};

printf("Please?input?the?number?of?rows:\n");

scanf("%d",&a);

for(int?i?=?1;?i?<=?a;?i++)

{

for?(int?j?=?0;?j?<?4;?j++)

{

b[i][j]?=?n?*?i?+?2?*?j;

printf("%d\t",b[i][j]);

}

printf("\n");

}

getchar();

return?0;

}

  • 上一篇:制作壹個H5抽獎活動可以怎麽實現,有什麽教程嗎?
  • 下一篇:微信小程序網絡購物糾紛管轄
  • copyright 2024編程學習大全網