1. Главная
  2. Библиотека
  3. Программирование
  4. Playgrounds Learn to Code 2 Collect the Total Challenge...
Решение задачи на тему

Playgrounds Learn to Code 2 Collect the Total Challenge: Collect a randomly determined number of gems, represented by totalGems. For this challenge, you're given a constant, total Gems , which is a randomly generated number from 1 to 12 . Using this

  • Программирование
  • #Основы алгоритмизации и программирования
  • #Структуры и алгоритмы обработки данных
Playgrounds Learn to Code 2 Collect the Total Challenge: Collect a randomly determined number of gems, represented by totalGems. For this challenge, you're given a constant, total Gems , which is a randomly generated number from 1 to 12 . Using this

Условие:

Playgrounds
Learn to Code 2
Collect the Total

Challenge: Collect a randomly determined number of gems, represented by totalGems.
For this challenge, you're given a constant, total Gems , which is a randomly generated number from 1 to 12 . Using this constant, write code to collect the number of gems defined in totalGems, stopping after that number is reached.
0

Решение:

Нам дана константа totalGems, которая содержит случайное число от 1 до 12. Нужно написать код, который будет собирать драгоценные камни до тех пор, пока не будет собрано именно это число. Для этого можно использовать цикл, который повторится totalGems раз ...

Выбери предмет