Дата активности | Консольный раздел | Прогресс | ||
---|---|---|---|---|
2022-06-14 | book | 110. Функции | 100 % | |
2022-06-10 | book | 101. Математика | 115 % | |
2022-06-03 | book | 100. Массивы | 100 % | |
2022-05-20 | book | 011. Циклы | 100 % | |
2022-05-19 | book | 010. Условия | 100 % | |
2022-05-17 | book | 001. Числа | 100 % | |
2022-05-10 | book | 000. Строки | 100 % | |
Итого: | 102 % |
double y = 0d;
for (double x = -2; x <= 2; x += 0.1)
{
y = (Math.Pow(x, 2) * Math.Sin(x)) / Math.Sqrt(Math.Abs(Math.Cos(x)));
Console.WriteLine("{0:f1}\t{1:f5}", x, y);
}
string[] line = Console.ReadLine().Split();
double a = double.Parse(line[0]);
double b = double.Parse(line[1]);
double c = double.Parse(line[2]);
double Discriminant = Math.Pow(b, 2) - 4 * a * c;
if (Discriminant > 0)
{
double x1 = (-b + Math.Sqrt(Discriminant)) / (2 * a);
double x2 = (-b - Math.Sqrt(Discriminant)) / (2 * a);
Console.Write("{0:0.000} {1:0.000}", x1 < x2 ? x1 : x2, x1 > x2 ? x1 : x2);
}
else if (Discriminant == 0)
Console.WriteLine("{0:0.000}", -b / 2 * a);
else
Console.WriteLine("NO");
using System;
class VideoSharp
{
static void Main()
{
int N = int.Parse(Console.ReadLine());
string[] line = Console.ReadLine().Split();
int[] nums = Array.ConvertAll(line, int.Parse);
int max = 0;
int min = 0;
for (int i = 0; i < nums.Length; i++)
{
if (nums[i] > nums[max])
max = i;
if (nums[i] < nums[min])
min = i;
}
var temp = nums[min];
nums[min] = nums[max];
nums[max] = temp;
foreach (int i in nums)
Console.Write(i + " ");
Console.WriteLine();
}
}
static void Main(string[] args)
{
long num = Convert.ToInt64(Console.ReadLine());
long square = num*num;
long sum = 0;
while (num > 0)
{
sum += num % 10;
num = num / 10;
}
Console.WriteLine("{0} {1}", sum, square);
}
static void Main()
{
// Первый способ (Convert.ToInt32)
long num1 = Convert.ToInt64(Console.ReadLine()) + 1;
// Второй способ (Parse)
string string2 = Console.ReadLine();
long num2 = long.Parse(string2) + 1;
// Третий способ (tryParse)
string string3 = Console.ReadLine();
long num3;
long.TryParse(string3, out num3);
num3 += 1;
// Вывод результата
Console.WriteLine(num1 + " " + num2 + " " +num3);
}