Advertisement
Guest User

Untitled

a guest
Mar 19th, 2018
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. #include <fstream>
  2. using namespace std;
  3. ifstream f("chenar.in");
  4. ofstream g("chenar.out");
  5. int a[200][200],n,i,j;
  6. int main()
  7. {
  8. f>>n;
  9. for(i=1;i<=n;i++)
  10. for(j=1;j<=n;j++)
  11. f>>a[i][j];
  12. for(j=1;j<=n;j++)
  13. g<<a[1][j]<<" ";
  14. for(i=2;i<n;i++)
  15. g<<a[i][n]<< " ";
  16. for(j=n;j>1;j--)
  17. g<<a[n][j]<<" ";
  18. for(i=n;i>1;i--)
  19. g<<a[i][1]<< " ";
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement