看看下面c++程序错在哪了?

#include<iostream>#include<cmath>usingnamespacestd;floata,b,c;floatt();floats();intma... #include<iostream>
#include<cmath>
using namespace std;
float a,b,c;
float t();
float s();
int main()
{ float x1,x2;
cout<<"请分别输入a,b,c的值:";
cin>>a>>b>>c;
cout<<"x1="<<m+n;
cout<<"x2="<<m-n<<endl;
return 0;
}
float t()
{float n;
n=(sqrt(b*b-4*a*c))/(2*a);
return (n);
}
float s()
{float m;
m=-b/(2*a);
return (m);
}

编译错误提示:
E:\c++练习程序\zbp.cpp(9) : error C2018: unknown character '0xa3'
E:\c++练习程序\zbp.cpp(9) : error C2018: unknown character '0xbb'
E:\c++练习程序\zbp.cpp(10) : error C2146: syntax error : missing ';' before identifier 'cin'
E:\c++练习程序\zbp.cpp(11) : error C2065: 'm' : undeclared identifier
E:\c++练习程序\zbp.cpp(11) : error C2065: 'n' : undeclared identifier
Error executing cl.exe.

zbp.obj - 5 error(s), 0 warning(s)
展开
 我来答
匿名用户
2009-11-10
展开全部
//---------------------------------------------------------------------------
#include<iostream>
#include<cmath>
using namespace std;
float a,b,c;
float t();
float s();
int main()
{ float x1,x2;/
cout<<"请分别输入a,b,c的值:";/*注意 这里,末尾的分号要在英文状态下输入*/
cin>>a>>b>>c;
cout<<"x1="<<t()+s();/*注意这里*/
cout<<"x2="<<s()-t()<<endl;/*注意这里*/
return 0;
}
float t()
{float n;
n=(sqrt(b*b-4*a*c))/(2*a);
return (n);
}
float s()
{float m;
m=-b/(2*a);
return (m);
}

//---------------------------------------------------------------------------
百度网友3b928efda6
2009-11-10 · TA获得超过123个赞
知道答主
回答量:110
采纳率:0%
帮助的人:24.6万
展开全部
下面的m和n是在子函数里定义主函数中不可见!所以显示没定义m和n!至于上边的有非法字符不能打印的错误我没看出来!你看看是不是建错文件了
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
百度网友dbecaad78
2009-11-10 · TA获得超过2402个赞
知道大有可为答主
回答量:2592
采纳率:0%
帮助的人:1438万
展开全部
m n 没有定义
cout<<"请分别输入a,b,c的值:"; 可能用全拼的分号

额~~~~ 你在记事本里面写的么?
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 更多回答(1)
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式