Advertisement
halexandru11

var 6

Apr 19th, 2021
81
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <cstring>
  3.  
  4. using namespace std;
  5.  
  6. struct figura {
  7.     struct {
  8.         float x, y;
  9.     } centru;
  10.     float diametru;
  11. } c;
  12.  
  13. void numar(unsigned long n, int c, long& m) {
  14.     m = 0;
  15.     long p = 1;
  16.     while(n) {
  17.         if(n%10 != c) {
  18.             m = p*(n%10) + m;
  19.             p *= 10;
  20.         }
  21.         n /= 10;
  22.     }
  23.     if(m == 0) {
  24.         m = (p == 1 ? -1 : 0);
  25.     }
  26. }
  27.  
  28. int main() {
  29.     unsigned int a[22][22] = {0};
  30.     unsigned int n;
  31.  
  32.     cin >> n;
  33.     for(int i = 0; i < n; ++i) {
  34.         for(int j = n-i-2; j >= 0; --j) {
  35.             a[i][j] = a[n-1-i][n-1-j] = a[i][j+1] + 1;
  36.         }
  37.     }
  38.  
  39.     for(int i = 0; i < n; ++i) {
  40.         for(int j = 0; j < n; ++j) {
  41.             cout << a[i][j] << " ";
  42.         }
  43.         cout << "\n";
  44.     }
  45. }
Advertisement
RAW Paste Data Copied
Advertisement