1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
tresset_1 [31]
3 years ago
8

Pomógłbymi ktoś z takim zadaniem? C++

Computers and Technology
1 answer:
Elenna [48]3 years ago
8 0

#include <iostream>

using namespace std;

int main(int argc, char** argv) {

 

int n;

cout<<"Podaj n: ";

cin>>n;

 

int **tab=new int *[n];

 

for(int i=0;i<n;i++){

 tab[i]=new int [n];

}

 

for (int l=0;l<n;l++){

 for(int j=0;j<n;j++){

  if(j==l || n-l-1==j) tab[l][j]=0;

  else tab[l][j]=1;

 }

}

 

 for (int i=0;i<n;i++){

 for(int j=0;j<n;j++){

 cout<<tab[i][j];

 }

 cout<<"\n";

}

 

for(int i=0;i<n;i++){

  delete [] tab[i];

}

delete [] tab;

return 0;

}

Siema Marcin tak wgl.

You might be interested in
Why won't my Brainly let me make an account? I have shut my computer down, closed the tab, and opened it, I have tried EVERYTHIN
xxTIMURxx [149]

<u>Explanation:</u>

You may try opening the Brainly website using your browser's incognito mode. In other words,

Go to the Brainly website on Incognito mode > click Join and then follow the process to create an account.

However, if the issue persists you may then click the Contact Us button on the Homepage of the website and fill the accompanying form to send in your complaints.

6 0
3 years ago
What formula would you enter to add the values in cells b4, b5, and b6?
Semenov [28]
=SUM(b4:b6)  If it doesn't show the $ sign just make sure it's in currency :)  I hope this helped!! Good Luck!!! :)
4 0
4 years ago
What is a teaser and what is an audience
Taya2010 [7]
Teaser - Only showing a part of a clip or something to hook to audience 
Audience - The ones watching or viewing 
6 0
3 years ago
Write a program that inputs two characters first and second, and then prints all non-alphabetic characters starting from second
baherus [9]

Answer:

fbtcft gdfgfffff tvfft gxf

8 0
3 years ago
Which of the following is not an advantage of a dbms?
vovikov84 [41]
I looked it up and A seems to be it
7 0
3 years ago
Read 2 more answers
Other questions:
  • The picture that graphically represents the items you use in Windows is called a/an
    15·1 answer
  • Python: Write a program that asks the user how many Fibonnaci numbers to generate and then generates them.
    10·1 answer
  • Brian is selecting an authentication protocol for a PPP connection. He would like to select an option that encrypts both usernam
    7·1 answer
  • Function countValues = CreateArray(endValue) % endValue: Ending value of countValues
    7·1 answer
  • Which institution developed outside the limits of the written costitution of the united states ?
    14·1 answer
  • What is computer software
    8·2 answers
  • Importance of Microsoft access​
    5·1 answer
  • In this problem, you will fill in the code for a function count_digits(val) that takes a positive integer, val, and returns a li
    12·1 answer
  • Using a combination of symmetric and asymmetric key encryption, Sofia sent a report to her home office in Indiana. She received
    12·1 answer
  • (b) A mouse is a display device. (c) A monitor is a television.​
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!