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

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 14:10
Dean wants a quick way to look up staff members by their staff id. in cell q3, nest the existing vlookup function in an iferror function. if the vlookup function returns an error result, the text “invalid staff id” should be displayed by the formula. (hint: you can test that this formula is working by changing the value in cell q2 to 0, but remember to set the value of cell q2 back to 1036 when the testing is complete.)
Answers: 3
question
Computers and Technology, 23.06.2019 01:10
Are special combinations of keys that tell a computer to perform a command. keypads multi-keys combinations shortcuts
Answers: 1
question
Computers and Technology, 24.06.2019 12:30
Why does the pc send out a broadcast arp prior to sending the first ping request
Answers: 1
question
Computers and Technology, 24.06.2019 16:00
What is a dashed line showing where a worksheet will be divided between pages when it prints? a freeze pane a split box a page break a print title
Answers: 1
You know the right answer?
Se numeşte permutare a unei mulţimi finite orice rearanjare a tuturor elementelor acelei mulţimi. C...
Questions
question
English, 02.11.2020 20:20
question
Social Studies, 02.11.2020 20:20
question
Arts, 02.11.2020 20:20
Questions on the website: 13722367