Compare commits
1 Commits
c2ba2f3af1
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 1f718ce9d8 |
@@ -1,4 +1,3 @@
|
||||
|
||||
fun main() {
|
||||
var x: Int? = null;
|
||||
var y: Int? = null;
|
||||
@@ -17,15 +16,17 @@ fun main() {
|
||||
|
||||
print("Max = ");
|
||||
max = readLine()?.toInt()
|
||||
} catch (_: NumberFormatException) {}
|
||||
} catch (_: NumberFormatException) {
|
||||
}
|
||||
|
||||
|
||||
if(x != null && y != null && max != null && min != null && min <= max) {
|
||||
if (x != null && y != null && max != null && min != null && min <= max) {
|
||||
val strings = List(max - min) { // Creo la lista utilizzando lambda expression
|
||||
val n = it+min // it rappresenta l'indice della lista che sto inizializzando, il numero corrispondente è quindi it+min
|
||||
if(n % x == 0) {
|
||||
val n =
|
||||
it + min // it rappresenta l'indice della lista che sto inizializzando, il numero corrispondente è quindi it+min
|
||||
if (n % x == 0) {
|
||||
"Cip"
|
||||
} else if(n % y == 0) {
|
||||
} else if (n % y == 0) {
|
||||
"Ciop"
|
||||
} else {
|
||||
n
|
||||
|
||||
Reference in New Issue
Block a user