问题标题: 酷町堂:3995

0
0
已解决
叶珂睿
叶珂睿
新手天翼
新手天翼

#include<iostream>

#include<cstdio>

#include<cmath>

#include<cstring>

#include<algorithm>

#include<string>

#include<iomanip>

#include<sstream>

using namespace std;

int a[105][105],m,n;

int main(){

    cin>>m>>n;

    for(int i=1;i<=n;i++){

        for(int j=1;j<=m;j++){

            cin>>a[i][j];

        }

    }

    for(int i=1;i<=n;i++){

    swap(a[1][i],a[m][i]);

    }

    for(int i=1;i<=m;i++){

        swap(a[i][1],a[i][n]);

    }

    for(int i=1;i<=m;i++){

        for(int j=1;j<=n;j++){

            cout<<a[i][j]<<" ";

        }

    cout<<endl;

    }

    return 0;

}


0
0
蔡辰夕
蔡辰夕
新手启示者
新手启示者

​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​

我要回答