-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlessoncodereviewneeded.cs
More file actions
executable file
·141 lines (114 loc) · 4.22 KB
/
lessoncodereviewneeded.cs
File metadata and controls
executable file
·141 lines (114 loc) · 4.22 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Test_task1
{
class Program
{
static void Main(string[] args)
{
/*
int num = 0;
Console.WriteLine("Input number");
num = Convert.ToInt32(Console.ReadLine());
int num2 = num % 100;
int num3 = num / 100;
Console.Write(num2);
Console.WriteLine(num3);
Console.WriteLine(n / 100 + n % 100 * 10); //Answer. Output through place holders
Console.ReadLine();
*/
/*Console.WriteLine("Enter destination");
string destination = Console.ReadLine();
switch (destination)
{
case "left":
Console.WriteLine("U turn left");
break;
case "right":
Console.WriteLine("U turn right");
break;
case "straght":
Console.WriteLine("U turn stright");
break;
default:
Console.WriteLine("default");
break;
}
*/
/*
Console.WriteLine("Hi. Make your choise");
int answer = Convert.ToInt32(Console.ReadLine());
switch (answer)
{
case 1:
case 7:
Console.WriteLine("Raise balance");
break;
case 2:
case 10:
case 11:
Console.WriteLine("Check your balance");
break;
case 3:
Console.WriteLine("Account info");
break;
case 4:
Console.WriteLine("Exit to previous menu");
break;
default:
Console.WriteLine("Wrong choise");
break;
}
//ConsoleColor color = ConsoleColor.DarkBlue;
*/
/*
int x = 16;
while (x >= 6)
{
Console.WriteLine(x);
x -= 2;
}
int i = 10;
Console.WriteLine(" ");
do
{
Console.WriteLine(i);
i--;
} while (i >= 1);
Console.ReadLine();
*/
/*
int b = 0;
for (int a = 0; a <= 10; a++)
{
b += a;
}
Console.WriteLine(b);
*/
//simple numbers counting less than 200000000
//1000000007
int s = 0;
s = Convert.ToInt32(Console.ReadLine());
if ((s / s == 1) && (s / 1 == s))
{
Console.WriteLine("Simple");
}
else
{
Console.WriteLine("Non Simple");
}
Console.ReadKey();
//HOMETASK
"Вычислить сумму цифр произвольного положительного числа N. (N < 1000000000)"
"Пример: N = 1234 Ответ: 10"
"Вычислить количество единиц в двоичной записи произвольного положительного числа N. (N < 1000000000)"
"Пример N=15 Ответ: 4"
"Назрвем дигитацией целого числа следующую процедуру. Сначала вычисляем сумуму цифр числа. Если полученный результат больше 9, то повторяем процедуру, пока не получим цифру от 1 до 9. Найти результат дигитации числа N. (N < 1000000000)"
"N = 4 Ответ 6"
"4! = 24; 2 + 4 == "
}
}
}