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
A digital certificate system: Group of answer choices uses digital signatures to validate a user's identity. is used primarily b
kompoz [17]

Answer:

uses third party CAs to validate a user's identity

Explanation:

The Digital Certificate is the only means that technically and legally guarantees the identity of a person on the Internet. This is an essential requirement for institutions to offer secure services over the Internet. Further:

The digital certificate allows the electronic signature of documents The recipient of a signed document can be sure that it is the original and has not been tampered with and the author of the electronic signature cannot deny the authorship of this signature.

The digital certificate allows encryption of communications. Only the recipient of the information will be able to access its content.

4 0
3 years ago
Summarize who you believe cyber criminals are, and why?
sergij07 [2.7K]

Answer:

 The cyber criminals are the people that are engaged with getting the data in an unapproved way and furthermore mischief to the association henceforth are considered as cyber criminals.

Cyber criminals are people or groups of individuals who use innovation to committed the malicious exercises on computerized frameworks or systems with the aim of taking the organization data or individual information and producing benefit.

There are many types of cyber criminals that are:

  • Internet stalkers
  • Cyber terrorist
  • Identity thieves

5 0
3 years ago
Write an algorithm to sum to values
Elis [28]

Answer:

There is no need to make an algorithm for this simple problem. Just add the two numbers by storing in two different variables as follows:

Let a,b be two numbers.

c=a+b;

print(c);

But, if you want to find the sum of more numbers, you can use any loop like for, while or do-while as follows:

Let a be the variable where the input numbers are stored.

while(f==1)

{

printf(“Enter number”);

scanf(“Take number into the variable a”);

sum=sum+a;

printf(“Do you want to enter more numbers? 1 for yes, 0 for no”);

scanf(“Take the input into the variable f”);

}

print(Sum)

Explanation:

hi there answer is given mar me as brainliest

5 0
3 years ago
what is one example of the decomposers taking from the ecosystem and one of them giving to the ecosystem
adelina 88 [10]
Like when a seed drops on the ground, and a bee come to take some honey. It sticks to the bee and where the bee goes, the bee will rub it off and the seed will start to grow.
8 0
2 years ago
1.Write a Java program to solve the following problem using modularity. Write a method that rotates a one-dimensional array with
Westkost [7]

Answer:

Explanation:

The following code is written in Java and it asks the user for the size of the array. Then it randomly populates the array and prints it. Next, it rotates all the elements to the right by 1 and prints the new rotated array.

import java.util.ArrayList;

import java.util.Arrays;

import java.util.Random;

import java.util.Scanner;

class Brainly {

   public static void main(String[] args) {

       Random r = new Random();

       Scanner in = new Scanner(System.in);

       System.out.println("Enter Size of the Array: ");

       int arraySize = in.nextInt();

       ArrayList<Integer> myList = new ArrayList<>();

       for (int x = 0; x < arraySize; x++) {

           myList.add(r.nextInt(15));

       }

       System.out.println("List Before Rotation : " + Arrays.toString(myList.toArray()));

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

           int temp = myList.get(myList.size()-1);

           for (int j = myList.size()-1; j > 0; j--) {

               myList.set(j, myList.get(j - 1));

           }

           myList.set(0, temp);

       }

       System.out.println("List After Rotation :  " + Arrays.toString(myList.toArray()));

   }

}

6 0
2 years ago
Other questions:
  • Sarah is entering weekly sales data for week 37 of the current year; however, when she moves down to thecells where she needs to
    8·2 answers
  • Ideally, how often should you back up the data on your computer? once an hour, once a day, once a month, once a year. Please hur
    5·2 answers
  • Do you believe that OOP should be phased out and we should start working on some alternative
    6·1 answer
  • ​this is another name for the wireless configuration in which a central wireless device is used to serve all wireless clients.
    13·1 answer
  • HELP 25 POINTS!!!!!
    6·2 answers
  • Where is permanent data in the computer stored whenever gym starts his laptop He sees some commands in numbers appearing on the
    12·1 answer
  • Which 3D game has Bentley the Bear collect gems while avoiding enemy trees, bees, ghosts, skeletons, and Berthilda the witch?
    9·1 answer
  • Your task is to implement a function replace_once(t, d), that takes a text t and a replacement dictionary d, and returns the res
    10·1 answer
  • The main difference between \f and \r is that \f produces a
    13·1 answer
  • Help PLEASE ILL MARK as brainlest
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!