Skip to content

Instantly share code, notes, and snippets.

@P0huber
P0huber / multipltable
Created June 24, 2017 14:39
Реализация таблицы умножения 10х10. Implementation of the multiplication table 10x10 on Java.
public static void Base (int a){ // The creating of the function: printing string ever 10 values.
for (int i = 1; i < 11; i++){ // The declaring of the cycle calculation of string values have been multiplying on the one particular number.
System.out.print(a * i + " "); // The printing of the result multiplication with a space.
}
}
public static void main(String[] args) {
int y = 1;
for (int x = 1; x < 11; x++){
Base(y); // Call the function
@P0huber
P0huber / balance
Created June 26, 2017 18:39
Расчет остатка секунд последнего часа от введенного значения с проверкой. Calculation of remainder seconds of last hour [Java].
import java.util.Scanner;
public class Solution {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
System.out.print("Enter any number seconds: ");
int n = s.nextInt(); // entering the any whole number
System.out.println("We have " + getCountSecondsPassedInCurrentHour(n) + " seconds of the last hour."); // call of function with the value
System.out.println("And it`s exactly: " + n / 3600 + " hours and " + n % 3600 + " seconds.");
}
@P0huber
P0huber / HowAreManyDaysInYear
Created June 29, 2017 05:29
Определение сколько дней в любом году. Description how are many days in any year [Java]
/*
Quantity days in a year
*/
import java.io.*;
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
System.out.print("Enter any year: ");
int x = Integer.parseInt(br.readLine());
String s = "Quantity days in this year: 36";
@P0huber
P0huber / IdentificationTypeOfNumber.java
Created July 2, 2017 13:25
Определение введенного числа. Identification of the entered number.
package com.javarush.task.task04.task0427;
/*
Описываем числа
*/
import java.io.*;
public class IdentificationTypeOfNumber {
private static void findCapacity(short x){
if(x > 0 && x < 10)
@P0huber
P0huber / findPositiveInteger.java
Last active August 25, 2017 12:13
Нахождение количества положительных чисел. The finding of quantity positive integers [Java].
package com.javarush.task.task04.task0428;
/* Положительное число */
import java.io.*;
public class findPositiveInteger {
public static void main(String[] args) throws Exception {
BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
int[] a = new int[3]; int i, j = 0;
for(i = 0; i < 3; i++)//creating 3 elements of array
a[i] = Integer.parseInt(r.readLine());
for(i = 0; i < 3; i++)
@P0huber
P0huber / CanvasOfLetters.java
Last active July 3, 2017 10:59
Создание полотна 10х10 из букв. The creation of letter canvas 10x10 [Java]
public class CanvasOfLetters {
private static String whileCycle(String s){
int a = 1;
while (a < 10) {//The creating of row containing 10 letters "S"
System.out.print(s);
a++;
}return s;
}
public static void main(String[] args) throws Exception {
int a = 1;
@P0huber
P0huber / multiplicationTable.java
Created July 3, 2017 13:42
Таблица умножения с помощью while. The multiplication table through while [Java]
package com.javarush.task.task04.task0434;
/*
Таблица умножения
*/
public class multiplicationTable {
private static String multiplication(int s){
int a = 1, g = 1;
@P0huber
P0huber / FindMiddleValue.java
Created July 4, 2017 20:49
Нахождение среднего значения. The finding a middle value [Java]
package com.javarush.task.task04.task0441;
/*
Как-то средненько
*/
import java.io.*;
public class FindMiddleValue {
public static void main(String[] args) throws Exception {
BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
@P0huber
P0huber / SummingJunction.java
Created July 4, 2017 21:37
Суммирование вводимых чисел. The summing junction of entered digits [Java]
package com.javarush.task.task04.task0442;
/*
Суммирование. Summing junction.
*/
import java.io.*;
public class SummingJunction {
public static void main(String[] args) throws Exception {
BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
@P0huber
P0huber / Everything-Java-\TriangleOfEights.java
Created July 5, 2017 03:17
Вывести треугольник восьмерок. The printing a triangle of eights [Java]
package com.javarush.task.task04.task0437;
/*
Треугольник из восьмерок
*/
public class TriangleOfEights {
public static void main(String[] args){String a = "8", b = "8";
for (; true;) {//this empty cycle for Verificator JavaRush only