public static void Main()
{
Console.Write("Введите первую тригонометрическую функцию (sin, cos, tan, cot): ");
string trig1 = Console.ReadLine();
Console.Write("Введите значение угла: ");
int degree1 = int.Parse(Console.ReadLine());
Console.WriteLine();
Console.Write("Введите вторую тригонометрическую функцию (sin, cos, tan, cot): ");
string trig2 = Console.ReadLine();
Console.Write("Введите значение угла: ");
int degree2 = int.Parse(Console.ReadLine());
var trigValue1 = GetTrigValue(trig1, degree1);
var trigValue2 = GetTrigValue(trig2, degree2);
Calc(trigValue1, trigValue2);
}
private static double GetTrigValue(string trigFunc, int degree){
switch(trigFunc){
case "sin": return Math.Sin(degree);
case "cos": return Math.Cos(degree);
case "tan": return Math.Tan(degree);
case "cot": return Math.Cot(degree);
default: return 0.0d;
}
}
private static void Calc(double val1, double val2){
Console.Write($"{val1} - {val2} = {val1 - val2}");
Console.Write($"{val1} + {val2} = {val1 + val2}");
...
}
int[] sum = new int[5];
int max = Int32.MinValue;
int maxColumnIndex = 0;
for (int k = 0; k < dataGridView1.Rows.Count; ++k)
{
for(int j = 0; j < dataGridView1.Rows[k].Cells.Count; j++)
{
var colSum = sum[j] + Convert.ToInt32(dataGridView1.Rows[k].Cells[j].Value);
sum[j] = colSum;
if(colSum > max){
max = colSum;
maxColumnIndex = j;
}
}
}
label1.Text = maxColumnIndex.ToString();
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
Pen pen = new System.Drawing.Pen(System.Drawing.Color.Red, 2);
e.Graphics.DrawLine(pen, 0, 0, 150, 150);
pen.Dispose();
}
function openURL()
{
let user = document.getElementById('userName').value;
let room = document.getElementById('roomName').value;
var url = '/?user=' + encodeURIComponent(user) + '&room=' + encodeURIComponent(room) ;
window.location.href = url;
}