|
@@ -0,0 +1,55 @@
|
|
|
|
+A+B:
|
|
|
|
+```
|
|
|
|
+int A = Convert.ToInt32(Console.ReadLine());
|
|
|
|
+int B = Convert.ToInt32(Console.ReadLine());
|
|
|
|
+Console.WriteLine(A+B);
|
|
|
|
+```
|
|
|
|
+
|
|
|
|
+Сумма:
|
|
|
|
+```
|
|
|
|
+int N = Convert.ToInt32(Console.ReadLine());
|
|
|
|
+int a = 0;
|
|
|
|
+if (N > 1)
|
|
|
|
+{
|
|
|
|
+ a = N * (N + 1) / 2;
|
|
|
|
+}
|
|
|
|
+else
|
|
|
|
+{
|
|
|
|
+ for (int i = 1; i <= N; ++i)
|
|
|
|
+ {
|
|
|
|
+ a += i;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+Console.WriteLine(a);
|
|
|
|
+```
|
|
|
|
+
|
|
|
|
+Пятью пять - двадцать пять!:
|
|
|
|
+int a, b, c;
|
|
|
|
+a = Convert.ToInt32(Console.ReadLine());
|
|
|
|
+b = Convert.ToInt32(Math.Pow(a, 2));
|
|
|
|
+c = b % 10;
|
|
|
|
+if (c == 5)
|
|
|
|
+{
|
|
|
|
+ Console.WriteLine(Math.Pow(a,2));
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+Игра:
|
|
|
|
+int b = 9;
|
|
|
|
+int a = Convert.ToInt32(Console.ReadLine());
|
|
|
|
+int c = b - a;
|
|
|
|
+int d = (a * 100) + (b * 10) + c;
|
|
|
|
+Console.WriteLine($"Загаданное число: {d}");
|
|
|
|
+
|
|
|
|
+Арифметика:
|
|
|
|
+int numOne = Convert.ToInt32(Console.ReadLine());
|
|
|
|
+int numTwo = Convert.ToInt32(Console.ReadLine());
|
|
|
|
+int numAnswer = Convert.ToInt32(Console.ReadLine());
|
|
|
|
+
|
|
|
|
+if (numAnswer == numOne * numTwo)
|
|
|
|
+{
|
|
|
|
+ Console.WriteLine("YES");
|
|
|
|
+}
|
|
|
|
+else
|
|
|
|
+{
|
|
|
|
+ Console.WriteLine("NO");
|
|
|
|
+}
|