Skip to content

Instantly share code, notes, and snippets.

@garbuchev
garbuchev / ZeroSubset
Created March 20, 2014 12:14
P12. Zero subset
using System;
class ZeroSubset
{
static void Main()
{
int n1 = 0;
int n2 = 0;
int n3 = 0;
int n4 = 0;
using System;
class BeerTime
{
static void Main()
{
DateTime timeBeer = new DateTime();
Console.Write("Enter time: ");
bool isValid = DateTime.TryParse(Console.ReadLine(), out timeBeer);
if (isValid)
using System;
class SumOf5Numbers
{
static void Main()
{
Console.WriteLine("Please enter 5 numbers separated by space:");
string input = Console.ReadLine();
string[] numbersText = input.Split();
double[] numbers = new double[5];
@garbuchev
garbuchev / PointsInsideHouse
Last active August 29, 2015 14:01
Problem 9.** Points inside the House
import java.util.Scanner;
public class P09PointsInsideHouse {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
double x = scan.nextDouble();
double y = scan.nextDouble();
//To simplify the problem let's divide the roof into 2 triangles
//at the line (17.5, 3)(17.5, 8.5)
@garbuchev
garbuchev / Full House with Jokers
Created May 22, 2014 08:14
P04 Full House with Jokers
public class P04FullHouseWithJokers {
public static void main(String[] args) {
int counterMain = 1;
System.out.println("* * * * *"); // fullHouse00
counterMain = fullHouse23(counterMain);
counterMain = fullHouse13(counterMain);
counterMain = fullHouse22(counterMain);
counterMain = fullHouse12(counterMain);
counterMain = fullHouse03(counterMain);