Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- // 5 4
- // 0 5 2 11 3 2 10 2 7 3 1 4 4 5 0 12 8 13 7 5
- using namespace std;
- int main(){
- int a[50][50], m, n, i, j, le;
- cin>>n>>m;
- for(i=0;i<n;i++)
- for(j=0;j<m;j++)
- cin>>a[i][j];
- le = a[n-1][m-1];
- for(i=0;i<n;i++){
- a[i][0] = le;
- a[i][m-1] = le;
- }
- for(i=1;i<m;i++){
- a[0][i] = le;
- a[n-1][i] = le;
- }
- for(i=0;i<n;i++){
- for(j=0;j<m;j++)
- cout<<a[i][j]<<' ';
- cout<<endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement