-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
105 lines (84 loc) · 3.32 KB
/
Program.cs
File metadata and controls
105 lines (84 loc) · 3.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
// Напишите программу, которая принимает на вход два числа и проверяет, является ли одно число квадратом другого.
// Квадрат в ОБЕ стороны.
// 5, 25 -> да
// -4, 16 -> да
// 25, 5 -> да
// 8,9 -> нет
// Console.WriteLine("input 2 numbers: ");
// // Считываем ввод пользователя и преобразуем его в числа
// int number1 = Convert.ToInt32(Console.ReadLine());
// int number2 = Convert.ToInt32(Console.ReadLine());
// if (number1==number2*number2 || number2==number1*number1)
// {
// Console.WriteLine($"{number1} is square of the {number2} or {number2} is square of the {number1}");
// }
// else
// {
// Console.WriteLine($"neitner {number1} nor {number2} is squere of each other");
// }
// //Напишите программу, которая принимает на вход координаты точки (X и Y), причём X ≠ 0 и Y ≠ 0 и выдаёт номер координатной четверти плоскости, в которой находится эта точка.
// Console.WriteLine("input (X and Y):");
// // Считываем значения X и Y с консоли
// Console.Write("X = ");
// double x = Convert.ToDouble(Console.ReadLine());
// Console.Write("Y = ");
// double y = Convert.ToDouble(Console.ReadLine());
// // Выводим результат напрямую
// if (x > 0 && y > 0)
// {
// Console.WriteLine("The point is in the 1st coordinate quarter");
// }
// else if (x < 0 && y > 0)
// {
// Console.WriteLine("The point is in the 2nd coordinate quarter.");
// }
// else if (x < 0 && y < 0)
// {
// Console.WriteLine("The point is in the 3rd coordinate quarter");
// }
// else if (x > 0 && y < 0)
// {
// Console.WriteLine("The point is in the 4th coordinate quarter");
// }
// else
// {
// Console.WriteLine("The point is on the axis or at the origin");
// }
// //Напишите программу, которая выводит третью с начала
// цифру заданного числа или сообщает, что третьей цифры
// нет.
// 456 => 6
// 91 => Третьей цифры нет
// Console.Write("enter number: ");
// int number = Convert.ToInt32(Console.ReadLine());
// int temp = number;
// if (number >= 100)
// {
// while (number > 999)
// {
// number /= 10;
// }
// Console.WriteLine($"The third digit of {temp} -> {number % 10}");
// }
// else
// {
// Console.WriteLine("The number has less than three digits)");
// }
// Напишите программу, которая на вход принимает натуральное число N, а на выходе показывает его цифры через запятую.
// Console.Write("Enter N: ");
// int N = Convert.ToInt32(Console.ReadLine());
// if (N <= 0)
// {
// Console.WriteLine("Error: Enter a natural number that is greater than 0.");
// return;
// }
// string digitsString = N.ToString();
// for (int i = 0; i < digitsString.Length; i++)
// {
// Console.Write(digitsString[i]);
// if (i < digitsString.Length - 1)
// {
// Console.Write(", ");
// }
// }
// Console.WriteLine();