Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- #define N 5
- using namespace std;
- void babra(int a[][N], unsigned n) {
- for(int i = 1; i < n; i++) {
- for(int j = 0; j < i; j++) {
- a[i][j] = a[i-1][j] + 1;
- a[n-1-j][n-1-i] = a[i][j];
- }
- }
- }
- void kiir(int a[][N], unsigned n) {
- for(int i = 0; i < n; i++) {
- for(int j = 0; j < n; j++) {
- cout << setw(2) << a[i][j];
- }
- cout << endl;
- }
- }
- int main() {
- int arr[N][N] = {};
- babra(arr, N);
- kiir(arr, N);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement