-3
与其他程序员一样我也是编程领域的新手,我想要在这个世界中生活,并在您的帮助下获得奖励。所以,我必须在Cmath中使用一个数学函数。C#数学函数
功能是
z1 = Sin2α + sin5α - Sin3α/cosα+1-2sin^2(2α)
z2= √x^3 + 3/x^3 - 3
我的结果为止...
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine ("First Program");
Console.WriteLine ("Enter an integer");
int x;
x = int.Parse(Console.ReadLine());
Console.WriteLine ("x = " + x);
Console.WriteLine("Enter a valid number");
//Solving the functions
double a = double.Parse(Console.ReadLine()); //Read the angle in degrees
a = a/180 * Math.PI;
double z = (Math.Cos(a)) + (Math.Cos(2 * a)) + (Math.Sin(6 * a)) + (Math.Cos(7 * a));
z = (x * x) + (2(x)) - (3) + (x + 1) * Math.Sqrt(x * x - 9)/(x * x) - (2(x)) - (3) + (x - 1) * Math.Sqrt(x * x - 9);
Console.WriteLine(z);
所有数学相关函数在'System.Math'类,因此'F = Math.Sin(2)...' – 2014-12-05 14:08:30
该函数将不编译。没有“2Sin * Sin2”。根本没有意义。 – duffymo 2014-12-05 14:10:09
Google搜索“C#数学函数”真的没有任何结果吗? – 2014-12-05 14:18:06