已知 a=1,b=2,c=3,x=2,计算y=ax2+bx+c之值 这题目该怎么用C#编程?
补充:表达式应是这样的:y=a乘以x的平方+bx+c的值
补充:表达式应是这样的:y=a乘以x的平方+bx+c的值
答案:using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
int a = 1;
int b = 2;
int c = 3;
int x = 2;
int y;
y = a * 2 + b * x + c;
Console.Write("{0}", y);
}
}
}int a=1;
int b=2;
int c=3;
int x=2;
int y;
y=a*2+b*x+c
out<<y;