Ascending Number Sorter Game

3 次查看(过去 30 天)
Julian Mork
Julian Mork 2021-5-2
回答: Manas 2022-8-1
Im just trying to make a number sorter "game" iguess you could call it where a user can input mutilple numbers unless below 0 or are a negative number and then the program puts them in ascending order

回答(1 个)

Manas
Manas 2022-8-1
Your question is certainly not related to matlab. I'm operating under the assumption of you wanting to implement a solution for sorting a set of numbers in matlab programming language.
num = input("Enter the numbers:");
num = sort(num);
if (num(1) <= 0)
disp("Invalid Input")
else
disp(sort(num));
end
please ensure to enter an array as input.

类别

Help CenterFile Exchange 中查找有关 Strategy & Logic 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by