• 2022-11-02
    在C语言中,如要给一个较大的[img=54x22]17de83d2fb35c85.png[/img]的数组赋值,以下方式性能较好的是:()
    A: for ( int i = 0; i <; N; i++ ) for ( int j = N - 1; j >;= 0; j-- ) mat[i][j] = val;
    B: for ( int i = 0; i <; N; i++ ) for ( int j = 0; j <; N; j++ ) mat[j][i] = val;
    C: for ( int i = N - 1; i >;= 0; i-- ) for ( int j = N - 1; j >;= 0; j-- ) mat[j][i] = val;
    D: for ( int i = N - 1; i >;= 0; i-- ) for ( int j = N - 1; j >;= 0; j-- ) mat[j][i] = val;