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