Трудности с функцией if else

Трудности с функцией if else - Messages

#1 Posted: 2021/6/28 06:07:21
Vasia

Vasia

0 likes in 17 posts.

Group: User

Здравствуйте!
Необходимо, чтобы на выходе, если удовлетворяются условия, выводился массив чисел. В моем случае, выводится одно число из последнего условия, когда по исходным данным удовлетворяются все условия.
Подскажите пожалуйста, что я делаю не так.
File not found.File not found.
#2 Posted: 2021/6/28 07:02:52
sergio

sergio

116 likes in 332 posts.

Group: User

So it works but it is likely that there are better solutions
example_s.sm (9.9 KiB) downloaded 638 time(s).

sergio
#3 Posted: 2021/6/28 07:05:53
Vasia

Vasia

0 likes in 17 posts.

Group: User

Wrote

So it works but it is likely that there are better solutions
example_s.sm (9.9 KiB) downloaded 638 time(s).

sergio



Спасибо, но как раз от такой записи хотелось уйти)
#4 Posted: 2021/6/28 08:40:43
Fridel Selitsky

Fridel Selitsky

520 likes in 451 posts.

Group: User

The solution can be represented as a function of lambda
example Ber7.sm (14.32 KiB) downloaded 646 time(s).
#5 Posted: 2021/6/28 11:16:12
Vasia

Vasia

0 likes in 17 posts.

Group: User

Wrote

The solution can be represented as a function of lambda
example Ber7.sm (14.32 KiB) downloaded 646 time(s).



Спасибо!
#6 Posted: 2021/6/28 12:06:05
Alvaro

Alvaro

1,078 likes in 1,749 posts.

Group: User

Hi. A couple of two more methods.

example.sm (19.48 KiB) downloaded 632 time(s).

Best regards.
Alvaro.
1 users liked this post
sergio 2021/6/28 13:23:00
#7 Posted: 2021/6/28 15:30:35
Alvaro

Alvaro

1,078 likes in 1,749 posts.

Group: User

Another way, with functions, like the Ber7 solution.

example_functions.sm (7.37 KiB) downloaded 649 time(s).

Best regards.
Alvaro.



#8 Posted: 2021/6/29 02:29:45
Vasia

Vasia

0 likes in 17 posts.

Group: User

Wrote

Hi. A couple of two more methods.

example.sm (19.48 KiB) downloaded 632 time(s).

Best regards.
Alvaro.



Спасибо, буду разбираться)
  • New Posts
  • No New Posts