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: | |
Создать класс Cat. Добавить ему свойство - name, которое будем получать при создании объекта класса, и пока пустой | |
метод feed. Создать объект класса Cat, вывести в консоль его имя и затем удалить объект. | |
*/ | |
function Cat(name) { | |
this.name = name; | |
this.feed = function() { | |
}; |
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
// update 10.06.2020 | |
#include <iostream> | |
#include <vector> | |
#include <sstream> | |
#include <queue> | |
#include <fstream> | |
#include <limits> | |
using namespace std; |
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
#include <iostream> | |
#include <vector> | |
#include <algorithm> | |
#include <string> | |
using namespace std; | |
struct Node { // класс Node ( Узел ) | |
string value; // значение узла - переменная типизированная которой присвоется данные | |
struct Node* next; // ссылка на следкюзий узел - переменная класа Node | |
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
//добавлен ввод из файла | |
// Доюавлен ввод из файла как альтернатива консольному вводу | |
// file.txt содержит элементы списка - введенные в строку через пробел | |
//// Class Run | |
public static void main(String[] args) throws FileNotFoundException { | |
System.out.println("Пожалуйста, если вы хотите использовать файл, нажмите F"); | |
System.out.println("Пожалуйста, если вы хотите использовать консоль, нажмите С"); | |
Scanner sc = new Scanner(System.in); |
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. Дан неупорядоченный линейный односвязный список и массив, содержащий номера | |
// соответствующих элементов в упорядоченном списке. Перестроить данный список с соответствии с номерами, заданными массивом. | |
//// Class Node | |
public class Node { // класс Node ( Узел ) | |
String value; // значение узла - переменная типизированная которой присвоется данные | |
Node next; // ссылка на следкюзий узел - переменная класа Node |
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
/// Class Node | |
public class Node { | |
int value; | |
// int level; | |
Node left; | |
Node right; | |
Node(int value) { | |
this.value = value; | |
right = null; |
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 javax.swing.JFrame; | |
public class SwingClass extends JFrame { | |
public SwingClass(){ | |
setTitle("Simple example"); | |
setSize(300,200); | |
setLocationRelativeTo(null); | |
setDefaultCloseOperation(EXIT_ON_CLOSE); |
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
Scanner sc = new Scanner(System.in); | |
System.out.println("Ваш ввод:"); | |
if (sc.hasNextInt()) { | |
int number = sc.nextInt(); // если с консоли вводиться число оно воспринимается int | |
System.out.println("Спасибо! Вы ввели число " + number); | |
} else { | |
String data = sc.next(); // прочтет первое слово | |
// String data = sc.nextLine(); // прочтет всю строку |
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.io.File; | |
import java.io.FileNotFoundException; | |
import java.util.Arrays; | |
import java.util.Scanner; | |
public class Main { |
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.io.File; | |
import java.io.FileNotFoundException; | |
import java.util.Arrays; | |
import java.util.Scanner; | |
public class Main { | |
public static void main(String[] args) throws FileNotFoundException { |
NewerOlder