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