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
import java.util.Scanner; | |
public class PersonalAssistant { | |
static Scanner sc = new Scanner(System.in); | |
public static void main(String[] args) { | |
greet("Aid", "2018"); | |
remindName(); | |
guessAge(); | |
count(); |
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
import java.util.Arrays; | |
import java.util.Scanner; | |
public class multiSum { | |
public static void main(String[] args) { | |
Scanner sc = new Scanner(System.in); | |
while (true) { | |
String line = sc.nextLine(); | |
if (line.isEmpty()) { | |
continue; |
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
/* | |
Создать классы: | |
1 Book: id, Название, Автор (ы), Издательство, Год издания, Количество страниц, Цена, Тип переплета. | |
2 Books: ArrayList<Book> books. Позволяет выполнить поиск: | |
a) список книг заданного автора; | |
b) список книг, выпущенных заданным издательством; | |
c) список книг, выпущенных после заданного года. | |
3 Клиентский класс BooksRunner, демонстрирующий работу предыдущих классов. | |
*/ |
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
/* | |
Создать классы: | |
1. Point (Immutable): double x, double y. Methods: getters . | |
2. Line (Immutable): Point start, Point end. Methods: double getLength( ). | |
3. Lines: ArrayList<Line> lines. Methods: void add(Line line), double sumLength( ), Line longestLine( ) | |
*/ | |
import java.util.ArrayList; | |
import java.util.List; |
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
/* | |
Создать классы: | |
1. Rectangle содержащий размеры (высоту и ширину), и умеющий подсчитывать свои периметр и площадь | |
2. Rectangles содержащий список прямоугольников, умеющий добавлять новые прямоугольники | |
и подсчитывать их суммарную площадь | |
3. Клиентский класс RectangleRunner, демонстрирующий работу предыдущих классов. | |
**/ | |
import java.util.ArrayList; | |
import java.util.List; |
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
public class MatrixRotation { | |
static void createMatrix(int[][] a) { | |
for (int i = 0; i < a.length; i++) { | |
for (int j = 0; j < a.length; j++) { | |
System.out.print(a[i][j] + " "); | |
} | |
System.out.println(); | |
} | |
System.out.println(); | |
} |
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
import java.util.Scanner; | |
public class Month { | |
static void setMonth(int a) { | |
String[] month = {"январь", "феваль", "март", "апрель", "май", "июнь", | |
"июль", "август", "сентябрь", "октябрь", "ноябрь", "декабрь"}; | |
String s; | |
try { | |
s = month[a - 1]; | |
System.out.println("Это месяц - " + s + "."); |
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 Lecture1; | |
import java.util.Scanner; | |
public class Palindrome { | |
public static void main(String[] args) { | |
Scanner sc = new Scanner(System.in); | |
System.out.println("Предполагаемое количество чисел: "); | |
int n = sc.nextInt(); | |
String palindromes = null; |