File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
tp1/src/main/kotlin/fmt/kotlin/fundamentals Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -5,25 +5,29 @@ class Tp1 {
5
5
var x = 0
6
6
7
7
fun incrementXAndReturnOldValue (): Int {
8
- return - 1 ;
8
+ return x ++ ;
9
9
}
10
10
11
11
fun incrementXAndReturnNewValue (): Int {
12
- return - 1 ;
12
+ return ++ x ;
13
13
}
14
14
15
15
fun sum (m : Int , n : Int ): Int {
16
- return - 1
16
+ return m + n
17
17
}
18
18
19
19
/* *
20
20
* n Number of bottles. Always more than 2.
21
21
*/
22
22
fun describeNbBottles (n : Int ): String {
23
- return " " ;
23
+ return " There are $n bottles " ;
24
24
}
25
25
26
26
fun describeWithDetailNbBottles (totalBottles : Int , nbWhiteBottles : Int , nbRedBottles : Int ): String {
27
- return " "
27
+ return """
28
+ There are $totalBottles bottles :
29
+ - $nbWhiteBottles bottles of white
30
+ - $nbRedBottles bottles of red
31
+ """ .trimIndent()
28
32
}
29
33
}
You can’t perform that action at this time.
0 commit comments