loom
1// Ветвления
2
3int x = 2;
4string d;
5
6// Проверка вложенных условных операторов
7if (x == 1)
8d = "one";
9else
10{
11if (x > 2 && 2 < x)
12d = "two";
13else
14d = "three";
15}
16
17sys.print("x = " + x + ", d = " + d);
18
19// Проверка каскадного условного оператора else if
20if (x == 1)
21d = "one";
22else if (x == 2)
23d = "two";
24else if (x == 3)
25d = "three";
26else
27d = "four";
28
29sys.print("x = " + x + ", d = " + d);
30
31