回覆列表
  • 1 # 使用者4912889400776

    #include

    int main(int argc, const char * argv[]) {

    int arr[4][4]={{25,36,78,13},{12,26,88,93},{75,18,22,32},{56,44,36,58}};

    int i,j,temp;

    printf("主對角線:\n");

    for(i=0;i

    printf("%d ",arr[i][i]);

    putchar("\n");

    printf("副對角線:\n");

    for(i=0;i

    printf("%d ",arr[i][4-i]);

    putchar("\n");

    printf("交換後:\n");

    for(i=0;i

    {

    temp=arr[0][i];

    arr[0][i]=arr[2][i];

    arr[2][i]=temp;

    }

    for(i=0;i

    {

    for(j=0;j

    printf("%d ",arr[i][j]);

    putchar("\n");

    }

    return 0;

    }

  • 中秋節和大豐收的關聯?
  • 青蛙賣泥塘的續寫怎麼寫?