詢問輸出結果- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main() {
- int a[3][3] = {};
- for (int i = 0; i < 3; i++) {
- for (int j = 0; j < 3; j++) {
- if (i == j)
- a[i][j] = i + j;
- else
- a[i][j] = 0;
- }
- }
- for (int i = 0; i < 3; i++) {
- for (int j = 0; j < 3; j++)
- printf("%d ", a[j][i]);
- printf("\n");
- }
-
- system("pause");
- return 0;
- }
複製代碼本帖隱藏的內容需要回復才可以瀏覽 |