subject

Problema 1 - factori 100 puncte gigel a aflat la matematică definiţia factorialului unui număr natural nenul n. acesta este produsul tuturor numerelor naturale începând cu 1 şi terminând cu numărul respectiv şi se notează cu n! . astfel, factorialul numărului natural 6 este 6! =1*2*3*4*5*6 şi este egal cu 720. factorialele numerelor naturale cresc însă extrem de repede. de exemplu, 7! =5040 în timp ce 10! =3628800. fiind un bun matematician, gigel a imaginat o altă metodă de a indica factorialul unui număr. astfel, el ştie că un număr natural nenul se poate descompune în factori primi. de exemplu 720 poate fi scris ca 24*32*51. gigel codifică descompunerea în factori primi astfel: 4 2 1 însemnând faptul că în descompunerea lui 720 în factori primi apare factorul 2 de 4 ori, factorul 3 apare de două ori şi factorul 5 apare o dată. cu alte cuvinte, gigel indică pentru fiecare număr prim ≤ n puterea la care acesta apare în descompunerea în factori primi a lui n! . cerinţă scrieţi un program care să citească o secvenţă de numere naturale nenule şi care să afişeze în modul descris în enunţ factorialele numerelor citite. date de intrare fişierul de intrare factori. in conţine mai multe numere naturale nenule, câte un număr pe linie. ultima linie a fişierului de intrare conţine valoarea 0 indicând faptul că setul de numere s-a terminat. date de ieşire fişierul de ieşire factori. out va conţine câte o linie pentru fiecare număr nenul din fişierul de intrare. pe linia i din fişierul de ieşire va fi descrisă descompunerea în factori primi a factorialului numărului de pe linia i din fişierul de intrare, în modul descris în enunţ. numerele scrise pe aceeaşi linie vor fi separate prin câte un spaţiu. restricţii şi precizări numerele naturale din fişierul de intrare (exceptând ultimul) sunt din intervalul [2, 6]. fişierul de intrare conţine maxim 10 numere naturale nenule.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 19:30
Write a function processpeople() that takes the name of a file as a parameter. each line of the file corresponds to information about a person. in particular a line contains either a name (in the form lastname,firstname with no spaces in it) or a name (lastname,firstname) and a year. the function will process the file, creating a person object for each line in the file. the function will print information about each line as it processes it, as well as appending the new person object into a list. make sure to use person methods to display information rather than recreating the work you did for the first problem. once the entire file has been processed, the function returns the list of person objects created from the file. if the file is empty, the function should return an empty list. if the input file cannot be opened, the function should print a message to that effect and then return an empty list. the following shows what would be displayed for two example files which have been provided in the link. the file none.txt does not exist. note that your function must work on an arbitrary file that consists of valid lines. you cannot assume anything about the file except that it contains lines that have the format described above.
Answers: 2
question
Computers and Technology, 22.06.2019 02:00
Aletter or menu command that starts an action when the user presses the designated letter and the alt key together is called what?
Answers: 1
question
Computers and Technology, 22.06.2019 23:30
In my email i got a message it says a quick message and in message details on who its from its says nicole and under nicole is [email protected] -
Answers: 1
question
Computers and Technology, 23.06.2019 20:40
On nba 2k 19, every time i try to join a my park game, it leads ro a website telling my dad that he needs ps plus. i already have ps plus though. how do i fix this?
Answers: 2
You know the right answer?
Problema 1 - factori 100 puncte gigel a aflat la matematică definiţia factorialului unui număr natur...
Questions
Questions on the website: 13722367