Неплучается откомпелировать, все вроде правильно, но выдает ошибки (отредактировать чтобы компелировалось) - C#
Формулировка задачи:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Laba2
{
class Program
{
static void Main(string[] args)
{
int alpha=0;
double z1=0.0;
Console.Write(Введите значение Альфа для 1й формулы и нажмите Enter: ");
alpha=Convert.ToInt32(Console.ReadLine));
z1 = (Math.Sin((alpha * Math.PI))-Math.Cos(alpha/4))/2-Math.Sin(alpha)-Math.Pow(Math.Cos(alpha),2);
Console.WriteLine("Значения выражения с агрументорм Альфа {1} будет {2}", alpha, z1);
//---------------------------------------------------------------------------------------------------------------------------
Console.WriteLine("-------------------------------------------------------------------");
//-----------------------------------------------------------------------------------
int x = 0;
int y = 0;
double z2=0.0;
Console.Write("Введите значение X и Y для 2й формулы и нажмите Enter: ");
x = Convert.ToInt32(Console.ReadLine());
y = Convert.ToInt32(Console.ReadLine());
z2 = Math.Pow(y, 2) - y * (Math.Cos(x / Math.PI));
Console.WriteLine("Значения второго выражения с аргументами X={0} Y={1} будет {2}", x, ,z2);
System.Console.ReadKey();
}
}
}
Решение задачи: «Неплучается откомпелировать, все вроде правильно, но выдает ошибки (отредактировать чтобы компелировалось)»
textual
Листинг программы
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Laba2 { class Program { static void Main(string[] args) { double alpha; double z1; Console.Write("Введите значение Альфа для 1й формулы и нажмите Enter: "); alpha = Convert.ToDouble(Console.ReadLine()); z1 = (Math.Sin((alpha * Math.PI))-Math.Cos(alpha/4))/2-Math.Sin(alpha)-Math.Pow(Math.Cos(alpha),2); Console.WriteLine("Значения выражения с агрументорм Альфа {0} будет {1}", alpha, z1); //--------------------------------------------------------------------------------------------------------------------------- Console.WriteLine("-------------------------------------------------------------------"); //----------------------------------------------------------------------------------- int x = 0; int y = 0; double z2=0.0; Console.Write("Введите значение X и Y для 2й формулы и нажмите Enter: "); x = Convert.ToInt32(Console.ReadLine()); y = Convert.ToInt32(Console.ReadLine()); z2 = Math.Pow(y, 2) - y * (Math.Cos(x / Math.PI)); Console.WriteLine("Значения второго выражения с аргументами X={0} Y={1} будет {2}", x,y,z2); Console.ReadKey(); } } }