SHARE
TWEET

problema aia cu jumatati hatz




Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int n;
- cin >> n;
- int mt[n][n];
- for(int i = 0; i < n; i++) {
- for(int j = 0; j < n; j++) {
- cin >> mt[i][j];
- }
- }
- int k = n - 1;
- for(int i = 0; i < n; i++) {
- for(int j = 0, l = n - 1; j < n; j++) {
- if(i + j + 1 <= n + 1 && k + l + 1 >= n) {
- mt[k][l] = mt[i][j];
- }
- l--;
- }
- k--;
- }
- for(int i = 0; i < n; i++) {
- for(int j = 0; j < n; j++) {
- cout << mt[i][j] << " ";
- }
- cout << "\n";
- }
- return 0;
- }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.