subject

Se numeşte permutare a unei mulţimi finite orice rearanjare a tuturor elementelor acelei mulţimi. Cerinţa
Se dă un şir cu n elemente, numere naturale. Să se verifice dacă reprezintă o permutare a mulţimii {1,2,...,n}.

Date de intrare
Programul citește de la tastatură numărul n, iar apoi cele n elemente ale şirului, separate prin spaţii.

Date de ieşire
Programul afișează pe ecran mesajul DA, dacă şirul reprezintă o permutare a mulţimii {1,2,...,n}, respectiv NU în caz contrar.

Restricţii şi precizări
1 ≤ n ≤ 100
Exemplul 1:
Date de intrare

5
2 5 4 3 1
Date de ieșire

DA
Exemplul 2:
Date de intrare

5
2 5 4 3 9
Date de ieșire

NU
Încărcare soluție

Lipește codul aici

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 10:40, almaga1979orfvwo
5. illustrate how fine-line inventory classification can be used with product and market segments. what are the benefits and considerations when classifying inventory by product, market, and product/market?
Answers: 2
image
Computers and Technology, 22.06.2019 23:30, jhonpiper
For her science class, elaine is creating a presentation on weather in the united states. she wants to make the presentation beautiful and interesting by drawing simple cloud or wave shapes. which is the best way for elaine to draw these shapes?
Answers: 1
image
Computers and Technology, 23.06.2019 02:00, HannahVance99
In the context of an internet connection, llc stands for leased line connection liability limited company local loop complex local loop carrier
Answers: 1
image
Computers and Technology, 24.06.2019 00:40, ndurairajownkpq
What social factors affect your health
Answers: 3
You know the right answer?
Se numeşte permutare a unei mulţimi finite orice rearanjare a tuturor elementelor acelei mulţimi. C...

Questions in other subjects:

Konu
Mathematics, 17.08.2021 05:00
Konu
Mathematics, 17.08.2021 05:00