Си шарп с нуля

Формула программиста

основатель — Волосатов Евгений Витольдович
Поздравляю с 1 сентября! Система начисления Байтов работает.

 29450

-- John


John
  • Звание: Микробитер
  • Накопленный опыт: 45 часов
  • Баланс Мегахешей: собрано 0 Mh, потрачено 0 Mh
  • Баланс Байтов: нет
  • Не состоит в «Клубе формулистов»
  • Последний визит: 2023-05-11 16:28:53

Видеокурсы

Этот формулист не закончил ни одного видеокурса

Консольные задачи

Дата активности Консольный раздел Прогресс
2021-06-13 book 101. Математика 5 из 7 72 %
2021-03-25 book 100. Массивы все 8 100 %
2021-03-24 book 011. Циклы все 8 100 %
2021-03-24 book 010. Условия все 8 100 %
2021-03-23 book 001. Числа все 8 100 %
2021-03-23 book 000. Строки все 8 100 %
Итого: 45 из 47 96 %
Сохранить страницу:

29450. --
John
John
ответить
# Консоль / 101. Математика / Параметрическая функция / 2021-07-23 19:08

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ComeBack1
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("-------------------------");
            Console.WriteLine("|  t  |  x    |  y    |");
            Console.WriteLine("-------------------------");
            for (double i = 0.0; i < 7.01; i+=0.1)
            {
                double x = Math.Sin(3 * i) + 3 * Math.Cos(i);
                double y = Math.Cos(2*i);
                Console.WriteLine("| {0,3:f1} |  {1,6:f3} |  {2,6:f3} |",i,x,y);
            }
        }
    }
}


29450. --
John
John
ответить
# Консоль / 101. Математика / Формула / 2021-04-21 13:33

double a = double.Parse(Console.ReadLine());
            double x = double.Parse(Console.ReadLine());

                double result = (Math.Pow(Math.Pow(x, 3), 0.25) + a * x) / (Math.Log(Math.Sqrt(Math.Pow(a, 2) + Math.Sqrt(x)), Math.E));
                Console.WriteLine("{0:0.0000}", result);


29450. --
John
John
ответить
# Консоль / 100. Массивы / Баранки / 2021-03-25 20:04

int a = int.Parse(Console.ReadLine());
            int j = 0;
            int[] max = new int[a];     

            string[] nums = Console.ReadLine().Split();

            for (int i = 0; i < nums.Length; i++)
            {
                int converted = Convert.ToInt32(nums[i]);
                if (converted == 0) j++;

            }
            Console.WriteLine(j);


29450. --
John
John
ответить
# Консоль / 100. Массивы / Баранки / 2021-03-25 20:00

int a = int.Parse(Console.ReadLine());
            int[] max = new int[a];

           

            string[] nums = Console.ReadLine().Split();

            int j = 0;

            for (int i = 0; i < nums.Length; i++)
            {
                int converted = Convert.ToInt32(nums[i]);
                if (converted == 0) j++;

            }
            Console.WriteLine(j);

зачем вы там пишите по 100 строк кода?


29450. --
John
John
ответить
# Консоль / 100. Массивы / Мини-максимум / 2021-03-25 16:34

int a = int.Parse(Console.ReadLine());
            int[] max = new int[a];

            int[] nums = Array.ConvertAll(Console.ReadLine().Split(), Convert.ToInt32);

            Console.WriteLine(nums.Min()+" "+nums.Max());


29450. --
John
John
ответить
# Консоль / 100. Массивы / Мульти возведение / 2021-03-25 16:29

int a = int.Parse(Console.ReadLine());
            int[] max = new int[a];

            int[] nums = Array.ConvertAll(Console.ReadLine().Split(), Convert.ToInt32);

            for (int i = 0; i < nums.Length; i++)
            {
                if (i % 2 == 0)
                {
                    nums[i] *= nums[i];
                }
                else
                {
                    nums[i] *= 2;
                }
                Console.Write(nums[i] + " ");

            }
            Console.WriteLine();


29450. --
John
John
ответить
# Консоль / 100. Массивы / Инкремент / 2021-03-25 15:59

int a = int.Parse(Console.ReadLine());

            int[] max = new int[a];

            string[] value = Console.ReadLine().Split();



            string arg = null;


            for (int i = 0; i < value.Length; i++)
            {
                int inc = int.Parse(value[i]);
                inc += 1;
                string ac = inc + ",";
                if (i == value.Length -1)
                {
                    break;
                }
                Console.Write(ac);
                arg = ac;
            }
            Console.WriteLine(arg.Replace(",","."));


29450. --
John
John
ответить
# Консоль / 100. Массивы / Порядок / 2021-03-25 15:02

int a = Convert.ToInt32(Console.ReadLine());
            int[] nums = new int[a];

            string[] r = Console.ReadLine().Split();

            Array.Reverse(r);

            foreach (var item in r)
            {
                Console.Write(item + " ");
            }
            Console.WriteLine();


29450. --
John
John
ответить
# Консоль / 100. Массивы / Единичный массив / 2021-03-24 20:38

int a = Convert.ToInt32(Console.ReadLine());

            int[] array = new int[a];

            for (int i = 0; i < array.Length; i++)
            {
                array[i] = 1;
                Console.WriteLine(array[i]);
            }


29450. --
John
John
ответить
→  Froggy  # Консоль / 011. Циклы / Сумма цифр / 2021-03-24 17:26

ты чо еблан?


29450. --
John
John
ответить
# Консоль / 011. Циклы / Количество цифр / 2021-03-24 16:41

string a = Console.ReadLine();
            Console.WriteLine(a.Length);
:)


29450. --
John
John
ответить
# Консоль / 011. Циклы / Делитель Макса / 2021-03-24 16:26

Зачем сюда вообще break?

            int a = int.Parse(Console.ReadLine());
            int max = 0;
            for (int i = 1; i < a; i++)
            {
                if (a % i == 0)
                {
                    max = i;
                }
                if(false){break;}
            }
            Console.WriteLine(max);


29450. --
John
John
ответить
# Консоль / 011. Циклы / Делитель Макса / 2021-03-24 16:25

Зачем сюда вообще break?

            int a = 256;
            int max = 0;
            for (int i = 1; i < a; i++)
            {
                if (a % i == 0)
                {
                    max = i;
                }
            }
            Console.WriteLine(max);


29450. --
John
John
ответить
# Консоль / 011. Циклы / Без остатка / 2021-03-24 16:16

for (int i = 1; i < 100; i++)
            {
                if (i % 7 == 0)
                {
                    Console.WriteLine(i);
                    continue;
                }
            }


29450. --
John
John
ответить
# Консоль / 010. Условия / Неделька / 2021-03-24 16:05

byte a = byte.Parse(Console.ReadLine());

            switch (a)
            {
                case 1:
                    Console.WriteLine("понедельник");
                    break;
                case 2:
                    Console.WriteLine("вторник");
                    break;
                case 3:
                    Console.WriteLine("среда");
                    break;
                case 4:
                    Console.WriteLine("четверг");
                    break;
                case 5:
                    Console.WriteLine("пятница");
                    break;
                case 6:
                    Console.WriteLine("суббота");
                    break;
                case 7:
                    Console.WriteLine("воскресенье");
                    break;
                default:
                    Console.WriteLine("Введи число от 1 до 7");
                    break;
            }


29450. --
John
John
ответить
# Консоль / 010. Условия / Возрастание / 2021-03-24 15:50

//take user array
            int[] a = Array.ConvertAll(Console.ReadLine().Split(), Convert.ToInt32);

            //must if
            if (true)
            {
                //sorted Array
                int[] sorted = a.OrderBy(i => i).ToArray();

                //output sorted array
                for (int i = 0; i < sorted.Length; i++)
                {
                    Console.WriteLine(sorted[i]);
                }

            }


29450. --
John
John
ответить
# Консоль / 010. Условия / Три числа / 2021-03-23 20:15

string[] a = Console.ReadLine().Split();
            int a1 = int.Parse(a[0]), a2 = int.Parse(a[1]), a3 = int.Parse(a[2]);


            if (a1 == a2&&a2==a3&&a1==a3)
            {
                Console.WriteLine("YES");
            }
            else
            {
                Console.WriteLine("NO");
            }

или же:

Console.WriteLine(a1 == a2 && a2 == a3 && a1 == a3?"YES":"");


29450. --
John
John
ответить
# Консоль / 010. Условия / Максимум / 2021-03-23 20:02

int a = int.Parse(Console.ReadLine());
            int b = int.Parse(Console.ReadLine());

            if (a > b)
            {
                Console.WriteLine(a);
            }
            else
            {
                Console.WriteLine(b);
            }

            Console.WriteLine(a>b?a:b);


29450. --
John
John
ответить
# Консоль / 001. Числа / Формат / 2021-03-23 19:45

int a = int.Parse(Console.ReadLine());
            Console.WriteLine(a);
            Console.WriteLine("{0:d5}",a);
            Console.WriteLine("{0,5:d}",a);


29450. --
John
John
ответить
# Консоль / 001. Числа / Операции / 2021-03-23 19:30

string[] a = Console.ReadLine().Split();
            int n, n1;
            n = int.Parse(a[0]);
            n1 = int.Parse(a[1]);
            Console.WriteLine(n+n1);
            Console.WriteLine(n-n1);
            Console.WriteLine(n*n1);
            Console.WriteLine(n/n1);
            Console.WriteLine(n%n1);


29450. --
John
John
ответить
# Консоль / 001. Числа / Границы / 2021-03-23 19:21

Console.WriteLine("byte {0} {1}",byte.MinValue,byte.MaxValue);
            Console.WriteLine("short {0} {1}", short.MinValue, short.MaxValue);
            Console.WriteLine("ushort {0} {1}", ushort.MinValue, ushort.MaxValue);
            Console.WriteLine("int {0} {1}", int.MinValue, int.MaxValue);
            Console.WriteLine("uint {0} {1}", uint.MinValue, uint.MaxValue);
            Console.WriteLine("long  {0} {1}", long.MinValue, long.MaxValue);
            Console.WriteLine("ulong {0} {1}", ulong.MinValue, ulong.MaxValue);


29450. --
John
John
ответить
# Консоль / 001. Числа / Чтение / 2021-03-23 18:52

int usernum = int.Parse(Console.ReadLine());
            int usernum2 = Convert.ToInt32(Console.ReadLine());
            string usernum3 = Console.ReadLine();
            int parse;
            int.TryParse(usernum3, out parse);
            Console.WriteLine((usernum + 1) + " " + (usernum2 + 1) + " " + (parse + 1));


  • Звание: Микробитер
  • Накопленный опыт: 45 часов
  • Собранный капитал: нет

Клуб формулистов

Правила клуба формулистов

У каждого формулиста есть задача минимум на каждый день:
+ зайти на сайт, проверить один отчёт, получить 1 байт.
Задача максимум - выполнить все остальные ежедневные задачи.
Нажмите здесь чтобы перейти к ежедневному чек-листу.

В 24:00 МСК накопленные за сутки байты переносятся в недельный актив.
В воскресение 24:00 МСК все накопленные байты переходят на баланс формулиста.

Собранные байты можно обменивать на доступные видеокурсы (1 байт = 1 рубль, без скидок)
Приобретённые за байты видеокурсы доступны только во время нахождения в автобусе/клубе формулистов!

При завершении подписки в автобусе/клубе формулистов все накопленные байты обнуляются, а доступ к видеокурсам, приобретённым за байты, закрывается.
Продлевайте подписку заблаговременно.

Начинаем практику по языку C#





Если вы пришли без приглашения -
введите тысяча двадцать четыре (цифрами).
Чтобы стать хорошим программистом — нужно писать программы. На нашем сайте очень много практических упражнений.

После заполнения формы ты будешь подписан на рассылку «C# Вебинары и Видеоуроки», у тебя появится доступ к видеоурокам и консольным задачам.

Несколько раз в неделю тебе будут приходить письма — приглашения на вебинары, информация об акциях и скидках, полезная информация по C#.

Ты в любой момент сможешь отписаться от рассылки.