文章
40
粉丝
512
获赞
13
访问
375.0k
#include<cstdio>
#include<iostream>
using namespace std;
int arr[5][5];
int main(){
while(cin>>arr[0][0]){
cin>>arr[0][1];
cin>>arr[0][2];
cin>>arr[0][3];
cin>>arr[0][4];
for(int i=1;i<5;i++){
for(int j=0;j<5;j++){
cin>>arr[i][j];
}
}
int c,n,x,y;
cin>>c>>n>>x>>y;
if(c==2){//顺时针
if(n==2){
int temp=arr[x-1][y-1];
arr[x-1][y-1]=arr[x-1][y];
arr[x-1][y]=arr[x][y];
arr[x][y]=arr[x][y-1];
arr[x][y-1]=temp;
}else{
int temp=arr[x-1][y-1];
arr[x-1][y-1]=arr[x-1][y+1];
arr[x-1][y+1]=arr[x+1][y+1];
arr[x+1][y+1]=arr[x+1][y-1];
arr[x+1][y-1]=temp;
temp=arr[x][y-1];
...
登录后发布评论
暂无评论,来抢沙发