This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.javarush.test.level10.lesson11.home04; | |
| /* Большая зарплата | |
| Вывести на экран надпись «Я не хочу изучать Java, я хочу большую зарплату» 40 раз по образцу. | |
| Образец: | |
| Я не хочу изучать Java, я хочу большую зарплату | |
| не хочу изучать Java, я хочу большую зарплату | |
| не хочу изучать Java, я хочу большую зарплату | |
| е хочу изучать Java, я хочу большую зарплату | |
| хочу изучать Java, я хочу большую зарплату |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.javarush.test.level10.lesson11.home03; | |
| /* Правильный ответ: d=1.0 | |
| Добавить одну операцию по преобразованию типа, чтобы получался ответ: d=1.0. | |
| */ | |
| public class Solution | |
| { | |
| public static void main(String[] args) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.javarush.test.level10.lesson11.home02; | |
| /* Правильный ответ: d=5.5 | |
| Добавить одну операцию по преобразованию типа, чтобы получался ответ: d=5.5. | |
| */ | |
| public class Solution | |
| { | |
| public static void main(String[] args) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.javarush.test.level10.lesson11.home01; | |
| /* Правильный ответ: d=2.941 | |
| Добавить одну операцию по преобразованию типа, чтобы получался ответ: d=2.941. | |
| Пример вывода: 2.9411764705882355 | |
| */ | |
| public class Solution | |
| { | |
| public static void main(String[] args) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.javarush.test.level10.lesson04.task05; | |
| /* Задача №5 на преобразование целых типов | |
| Расставьте правильно операторы приведения типа, чтобы получился ответ: c=256 | |
| int a = (byte)44; | |
| int b = (byte)300; | |
| short c = (byte)(b - a); | |
| */ | |
| public class Solution |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.javarush.test.level10.lesson04.task04; | |
| /* Задача №4 на преобразование целых типов | |
| Добавить одну операцию по преобразованию типа, чтобы получался ответ: nine=9 | |
| short number = 9; | |
| char zero = '0'; | |
| int nine = (zero + number); | |
| */ | |
| public class Solution |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.javarush.test.level10.lesson04.task03; | |
| /* Задача №3 на преобразование целых типов | |
| Добавить одну операцию по преобразованию типа, чтобы получался ответ: b=0 | |
| float f = (float)128.50; | |
| int i = (int)f; | |
| int b = (int)(i + f); | |
| */ | |
| public class Solution |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.javarush.test.level10.lesson04.task02; | |
| /* Задача №2 на преобразование целых типов | |
| Расставьте правильно операторы приведения типа, чтобы получился ответ: d=3.765 | |
| int a = 15; | |
| int b = 4; | |
| float c = a / b; | |
| double d = a * 1e-3 + c; | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.javarush.test.level10.lesson04.task01; | |
| /* Задача №1 на преобразование целых типов | |
| Расставьте правильно операторы приведения типа, чтобы получился ответ: d > 0 | |
| int a = 0; | |
| int b = (byte) a + 46; | |
| byte c = (byte) (a*b); | |
| double f = (char) 1234.15; | |
| long d = (short) (a + f / c + b); | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.javarush.test.level09.lesson11.bonus03; | |
| import java.io.BufferedReader; | |
| import java.io.InputStreamReader; | |
| import java.util.ArrayList; | |
| /* Задача по алгоритмам | |
| Задача: Пользователь вводит с клавиатуры список слов (и чисел). Слова вывести в возрастающем порядке, числа - в убывающем. | |
| Пример ввода: | |
| Вишня |