diff --git a/src/Main.java b/src/Main.java index cf69aea..fbd6345 100644 --- a/src/Main.java +++ b/src/Main.java @@ -1,14 +1,16 @@ public class Main { public static void main(String[] args) { - int totalEnergy = 0; - int isolierglas = 5; - for (int i = 1; i <= isolierglas; i++) { - totalEnergy += i; - System.out.println(" Окно номер " + i + " успешно поднято на этаж. "); - } - System.out.println(" Всего затрачено энергии " + totalEnergy + " едениц."); - System.out.println(" Все окна доставлены, бригада свободна"); + int roomCount = 4; + int basePrice = 5000; + int total = 0; + + + for (int i = 1; i <= roomCount; i++) { + total += basePrice + (i -1) * 1000; + U.pl("Комната " + i + " расчитана."); + } + U.pl("Итоговая стоимоcть ремонта " + total); } } \ No newline at end of file diff --git a/src/U.java b/src/U.java new file mode 100644 index 0000000..632a293 --- /dev/null +++ b/src/U.java @@ -0,0 +1,15 @@ +public class U { + + public static void pl (String text) { + System.out.println(text); + } + public static void pl (int number) { + System.out.println(number); + } + public static void pl (double number) { + System.out.println(number); + } + public static void pl (float number) { + System.out.println(number); + } +}