This file contains 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
using System; | |
using System.Linq; | |
namespace SortArray | |
{ | |
class Program | |
{ | |
public static int[] GetRow(int[,] matrix, int rowNumber) |
This file contains 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 static void Print2d(int[,] TwoDArray) { | |
int numOfRows = TwoDArray.GetUpperBound(0) + 1; | |
int numOfcolumns = TwoDArray.Length / numOfRows; | |
for (int i = 0; i < numOfRows; i++) | |
{ | |
for (int j = 0; j < numOfcolumns; j++) | |
{ | |
Write(TwoDArray[i, j]); | |
} | |
WriteLine(); |
This file contains 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 static void Print2d(int[,] TwoDArray) { | |
int numOfRows = TwoDArray.GetUpperBound(0) + 1; | |
int numOfcolumns = TwoDArray.Length / numOfRows; | |
for (int i = 0; i < numOfRows; i++) | |
{ | |
for (int j = 0; j < numOfcolumns; j++) | |
{ | |
Write(TwoDArray[i, j]); | |
} |
This file contains 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
// Пользователь вводит 4-х-значное число, поменять местами 1 с 2 и 3 с 4 цифры. Если число не 4-х значное - вывести сообщение. | |
using System; | |
namespace ConsoleApp1 | |
{ | |
class Program | |
{ | |
public static string Swap(int[] numbers) | |
{ | |
for (int i = 1; i < numbers.Length; i += 2) |
This file contains 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
ublic static void image() | |
{ | |
Console.Write("Input Height Of Image:"); | |
int heightIm = Convert.ToInt32(Console.ReadLine()); | |
Console.Write("Input Width Of Image:"); | |
int widthIm = Convert.ToInt32(Console.ReadLine()); | |
if ((0 > heightIm) | (0 > widthIm)) | |
{ | |
Console.WriteLine("Image does not exist"); | |
} |
This file contains 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
int RoomLength = 6; | |
int RoomWidth = 2; | |
int RoomHeigth = 3; | |
double WallpaperWidth = .5; | |
int WallpaperLength = 10; | |
// wallpaper pieces | |
double numberOfDrops = (6 * 2 + 2 * 2) / 0.5; // two walls by their width = 32 | |
// wallpaper length |
This file contains 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
using System; | |
using System.Collections.Generic; | |
class Solver | |
{ | |
static bool IsEven(int number) | |
{ | |
return number % 2 == 0; | |
} |
This file contains 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.lisovitskiy.hw8; | |
import java.io.*; | |
import java.nio.*; | |
import java.nio.file.*; | |
public class TextEditor { | |
public static void createFile(String path, String name) { | |
File file = new File(path + name + ".txt"); | |
FileInputStream fs;// = null; |
This file contains 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 Test { | |
public static void m() { | |
//some code | |
} | |
public static void main(String[] args) { | |
m(); //этот метод знает что он определен в классе Test, и мы можем не ставить имя класса чтобы уточнить, что именно Test.m() нужно вызвать. как компилятор это понимает? | |
} | |
} | |
class Test2{ |
This file contains 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.lisovitskiy.hw5; | |
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.stream.Collectors; | |
public class Library { | |
private List<Book> books = new ArrayList<Book>(); | |
public void showAllBooks() { |