Reformat code
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
fun main() {
|
fun main() {
|
||||||
var x: Int? = null;
|
var x: Int? = null;
|
||||||
var y: Int? = null;
|
var y: Int? = null;
|
||||||
@@ -17,12 +16,14 @@ fun main() {
|
|||||||
|
|
||||||
print("Max = ");
|
print("Max = ");
|
||||||
max = readLine()?.toInt()
|
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 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
|
val n =
|
||||||
|
it + min // it rappresenta l'indice della lista che sto inizializzando, il numero corrispondente è quindi it+min
|
||||||
if (n % x == 0) {
|
if (n % x == 0) {
|
||||||
"Cip"
|
"Cip"
|
||||||
} else if (n % y == 0) {
|
} else if (n % y == 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user