编写c程序,计算并输出表达式S=(a-b)/sqrt(a+b)的值.其中a和c的值从键盘出入.#include #include void main() { int a,b,m; double s; printf("Please Input 2 number:\n"); scanf("%d,%d",&a,&b); do { m=(a+b); s=(double)((a-b)/sqrt(m));

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/01 11:55:43
编写c程序,计算并输出表达式S=(a-b)/sqrt(a+b)的值.其中a和c的值从键盘出入.#include #include void main() { int a,b,m; double s; printf(

编写c程序,计算并输出表达式S=(a-b)/sqrt(a+b)的值.其中a和c的值从键盘出入.#include #include void main() { int a,b,m; double s; printf("Please Input 2 number:\n"); scanf("%d,%d",&a,&b); do { m=(a+b); s=(double)((a-b)/sqrt(m));
编写c程序,计算并输出表达式S=(a-b)/sqrt(a+b)的值.其中a和c的值从键盘出入.
#include
#include
void main()
{
int a,b,m;
double s;
printf("Please Input 2 number:\n");
scanf("%d,%d",&a,&b);
do
{
m=(a+b);
s=(double)((a-b)/sqrt(m));
}while(m=0);
printf("s=%lf\n",s);
}
我这个程序哪编错了呀?

编写c程序,计算并输出表达式S=(a-b)/sqrt(a+b)的值.其中a和c的值从键盘出入.#include #include void main() { int a,b,m; double s; printf("Please Input 2 number:\n"); scanf("%d,%d",&a,&b); do { m=(a+b); s=(double)((a-b)/sqrt(m));
为什么要do while循环
我帮你改下
#include
#include
void main()
{
int a,b,m;
double s;
printf("Please Input 2 number:\n");
scanf("%d,%d",&a,&b);
m=a+b;
if(m>0)
s=(a-b)/sqrt(m);
printf("s=%lf\n",s);
}
输入的时候要 按a,b格式输入,我帮你试过了可以正常运行的