Advertisement
Guest User

Untitled

a guest
May 21st, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. int a[25][25];
  4. ifstream fin("chenar.in");
  5. ofstream fout("chenar.out");
  6. int main()
  7. {
  8. int n;
  9. fin >> n;
  10. for(int i=1; i <= n; i++){
  11. for(int j=1; j <= n; j++){
  12. fin >> a[i][j];
  13. }
  14. }
  15. for(int i=1; i <= n; i++)
  16. fout << a[1][i] << " ";
  17. for(int i=2; i <= n; i++)
  18. fout << a[i][n] << " ";
  19. for(int i=n-1; i >= 1; i--)
  20. fout << a[n][i] << " ";
  21. for(int i=n-1; i >= 2; i--)
  22. fout << a[i][1] << " ";
  23. return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement