Skip to content

Instantly share code, notes, and snippets.

View Nanich87's full-sized avatar

Nanko Geshkov Nanich87

View GitHub Profile
@Nanich87
Nanich87 / FireInTheMatrix.cs
Created January 21, 2024 17:52
Fire In The Matrix
using System;
namespace TelerikExamples {
class FireInTheMatrix {
static void Main() {
int fireWidth = int.Parse(Console.ReadLine());
int sideDots = (fireWidth - 2) / 2;
int middleDots = 0;
for (int i = sideDots; i >= 0; i--) {
@Nanich87
Nanich87 / SandGlass.vb
Created January 21, 2024 17:50
Sand-glass
Module SandGlass
Sub Main()
Dim n = Integer.Parse(Console.ReadLine())
Dim stars As Integer = n + 2
Dim add As Boolean = False
For i As Integer = 1 To n
If stars = 1 Then
add = True
End If
stars = If(add = False, stars - 2, stars + 2)
@Nanich87
Nanich87 / FirTree.vb
Created January 21, 2024 15:26
Fir Tree
Module FirTree
Sub main()
Dim height As Integer = Integer.Parse(Console.ReadLine())
Dim width As Integer = 1
For i As Integer = 2 To height - 1
width += 2
Next i
Dim asterisk As Integer = -1
Dim point As Integer = 0
For i = 1 To height
@Nanich87
Nanich87 / Tribonacci.vb
Created January 21, 2024 15:22
Tribonacci
Module Tribonacci
Sub main()
Dim T1 As Integer = Integer.Parse(Console.ReadLine())
Dim T2 As Integer = Integer.Parse(Console.ReadLine())
Dim T3 As Integer = Integer.Parse(Console.ReadLine())
Dim N As Integer = Integer.Parse(Console.ReadLine())
Dim i As Integer = 4
Dim nextMember As Integer = 0
While i <= N
nextMember = T1 + T2 + T3
@Nanich87
Nanich87 / Tribonacci.vb
Last active January 21, 2024 15:28
Tribonacci
Module Tribonacci
Sub main()
Dim T1 As Integer = Integer.Parse(Console.ReadLine())
Dim T2 As Integer = Integer.Parse(Console.ReadLine())
Dim T3 As Integer = Integer.Parse(Console.ReadLine())
Dim N As Integer = Integer.Parse(Console.ReadLine())
Dim T(N - 1) As Integer
T(0) = T1
T(1) = T2
T(2) = T3
@Nanich87
Nanich87 / CoffeeVendingMachine.cs
Created January 21, 2024 15:17
Coffee Vending Machine
using System;
namespace TelerikExamples {
class CoffeeVendingMachine {
static void Main() {
short i;
short j;
short[] coinsNumber = new short[5];
decimal[] coinsValue = {
0.05 M,
@Nanich87
Nanich87 / DrunkenNumbers.cs
Created January 21, 2024 15:16
Drunken Numbers
using System;
namespace TelerikExamples {
class DrunkenNumbers {
static void Main() {
// брой рундове - прочита се от конзолата
byte rounds = byte.Parse(Console.ReadLine());
// спечелени точки (една изпита бира = една точка)
int vladkoScore = 0;
int mitkoScore = 0;
@Nanich87
Nanich87 / Garden.cs
Created January 21, 2024 15:14
Garden
using System;
namespace TelerikExamples
{
class Garden
{
static void Main()
{
decimal[] seedsCosts = {0.5M, 0.4M, 0.25M, 0.6M, 0.3M, 0.4M};
decimal totalCosts = 0M;
@Nanich87
Nanich87 / BatGoikoTower.cs
Created January 21, 2024 15:10
Bat Goiko Tower
using System;
namespace TelerikExamples
{
class BatGoikoTower
{
static void Main()
{
int towerHeight = int.Parse(Console.ReadLine());
int currentDashIndex = 1;
@Nanich87
Nanich87 / ShipDamage.vb
Last active January 21, 2024 17:43
Ship Damage
Imports System.Drawing
Module ShipDamage
Sub Main()
' вход на данни
Dim line(10) As Integer
For i As Integer = 0 To line.Length - 1
line(i) = Integer.Parse(Console.ReadLine())
Next i
' дефиниране на правоъгълник,
' с начало долен ляв ъгъл (1) и посока обратна на часовниковата стрелка,