c#:关于数据类型转换的,运行时提示:错误 1 无法将类型“double”隐式转换为“float”。存在一个显式转?
privatevoidbutton1_Click(objectsender,EventArgse){intq=1,f=4,g=2;floatm=10.5f,p=10,n=...
private void button1_Click(object sender, EventArgs e)
{
int q = 1, f = 4, g = 2;
float m = 10.5f, p = 10, n = 4.0f, k;
k = (q + f) / g + (double)n * 1.2 / g + m;
label1.Text = k.ToString();
} 展开
{
int q = 1, f = 4, g = 2;
float m = 10.5f, p = 10, n = 4.0f, k;
k = (q + f) / g + (double)n * 1.2 / g + m;
label1.Text = k.ToString();
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询