问一道数学算法的题(高分悬赏)

2024-12-21 23:47:06
推荐回答(5个)
回答1:

#include
using namespace std;
int main()
{
float a,b,c,d,e,f;
cin>>a;
cin>>b;
if (a !=0 && b!=0)
{
c=a+b;
d=a-b;
e=a*b;
f=a/b;
cout<<"和是:"<cout<<"差是:"<cout<<"积是:"<cout<<"商是:"<}
else
cout<<"error"<return 0;
}

回答2:

#include
int main()
{
float a,b,c,d,e,f;
scanf("%f",&a);
scanf("%f",&b);
c=a+b;
d=a-b;
e=a*b;
f=a/b;
printf("和是:%f,差是:%f,积是:%f,商是:%f",c,d,e,f);
return 0;
}

回答3:

main()
{
float a,b,c,d,e,f;
scanf("%f%f",&a,&b);
if(a!=0&&b!=0)
{c=a+b;
d=a-b;
e=a*b;
f=a/b;}
printf("sum;%f difference;%f product;%f quotient;%f",c,d,e,f);
}

回答4:

sclieb 这个东西么?

95199252 来分给你

回答5:

# include
void main(){
float a,b;
printf("please input a,b:");
scanf("%f%f",&a,&b);
printf("a+b=%.2f\n",a+b);
printf("a-b=%.2f\n",a-b);
printf("a*b=%.2f\n",a*b);
printf("a/b=%.2f\n",a/b);
}