Skip to content

Latest commit

 

History

History
28 lines (25 loc) · 643 Bytes

C++乾坤大挪移问题.md

File metadata and controls

28 lines (25 loc) · 643 Bytes

在这里插入图片描述

#include <iostream>
using namespace std;

int main(){
	int a[10][10];
	for (int i = 0;i < 5;i ++){
		for (int j = 0;j < 5;j ++){
			cin >> a[i][j];
		}
	}
	for (int i = 0;i < 5;i ++){
		for (int j = 4;j > 0;j --){
			swap(a[i][j],a[i][j - 1]);
		}
	} 
	for (int i = 0;i < 5;i ++){
		for (int j = 0;j < 4;j ++){
			cout << a[i][j] << " ";
		}
		cout << endl;
	}
	return 0;
}