js城市切换代码,怎么进行动态调用城市名的??当前城市名哪里怎么写代码的,我用的帝国cms的,代码如下

如题所述

第1个回答  2016-06-21
#include<iostream>
#include<math.h>
using namespace std;
float p,q;
void m(int a,int b,int c,float d)
{
p=(-b+sqrt(d))/(2*a);
q=(-b-sqrt(d))/(2*a);
cout<<"x1=<<p<<" "<<"x2="<<q<<;
}
void f(int a,int b,int c,float d)
{
p=-b/(2*a); cout<<"x1=x2="<<p<<endl;
}
void j(int a,int b,int c,float d)
{
cout<<"无实根"<<endl;
}
int main()
{
int a,b,c;
float d;
cout<<"Input A B C"<<endl;
cin>>a>>b>>c;
d=b*b-4.0*a*c;
if(d>0)
{
m(a,b,c,d);
}
else if(d==0)
{
f(a,b,c,d);
}
else
{
j(a,b,c,d);
}
cout<<endl;
return 0;
}本回答被网友采纳