Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int v[21][21],n,k,x;
- cin>>n>>k;
- for(int i=1;i<=n;i++){
- for(int j=1;j<=n;j++){
- cin>>v[i][j];
- }
- }
- x=v[k][1];
- for(int j=1;j<=n-k-1;j++){
- v[k][j] = v[k][j + 1];
- }
- v[k][n-k]=x;
- for(int i=1;i<=n;i++){
- for(int j=1;j<=n;j++){
- cout<<v[i][j]<<" ";
- }
- cout<<endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement