跳到主要內容

程式設計-C語言 / OLD / 訊二甲( 江 ) / 上學期 / 1217-二維陣列之演練 (p228)

1

 

#include
 
int main()
{   /* 宣告二維陣列和指定初值 */
    int tests[3][2] = { { 74, 56 }, { 37, 68 }, { 33, 83 } };
    //                   0,0 0,1      1,0 1,1     2,0 2,1
    int x, y;
    while ( 1 ) {
        printf("請輸入兩個數 x(0~2), y(0~1) =");
        scanf( "%d,%d", &x, &y );
        printf("選擇到 %d \n", tests[x][y] );
    }
    return 0;
}
 

時間類別單位標題發佈點閱
跳至網頁頂部