没问题,这等小事,我帮你做了,只是功课还是要好好学:
#include "iostream.h"
#include "math.h"
void main()
{
float a,b,c;
cout<<"Input ax*x+bx+c=0:\na=";
cin>>a;
cout<<"b=";
cin>>b;
cout<<"c=";
cin>>c;
if(b*b-4*a*c<0)
{
cout<<"No radix in real number!"<
else
{
if(b*b-4*a*c==0) cout<<"A radix in real number is "<<(sqrt(b*b-4*a*c)-b)/(2*a);
else
{
cout<<"Two radixies in real number are x1="<<(sqrt(b*b-4*a*c)-b)/(2*a)<<" x2="<<(-sqrt(b*b-4*a*c)-b)/(2*a);
}
}
return;
}
#include
#include
using namespace std;
double a,b,c;
int main()
{
cin>>a>>b>>c;
if (b*b-4*a*c>=0)
{
printf("x1=%100.2f",(0-b+sqrt(b*b-4*a*c))/(2*a));
printf("x2=%100.2f",(0-b-sqrt(b*b-4*a*c))/(2*a));
}else printf("No Result");
system("pause");
}
复数根要不要输出啊
链表
队列
是向量计算器。。。
如果是为了交作业我就帮不了你了
如果是为了自己用,那可以考虑用DIRECTX里面的