为什么这个输出永远是0
#include<stdio.h>main(){float x,y,z;printf("input x,y: ");scanf("%f%f",&x,&y);if (x>=0.0 && y>0.0)z=((x*x+1)/(x*x+2))*y;if (x>0.0 && y<=0.0)z=(x-2)/(y*y+1); if (x<0.0)z=x+y; printf("z=%f ",z);}
不会啊,注意数据输入格式(必须用空格分开)
热门标签:
#include<stdio.h>main(){float x,y,z;printf("input x,y: ");scanf("%f%f",&x,&y);if (x>=0.0 && y>0.0)z=((x*x+1)/(x*x+2))*y;if (x>0.0 && y<=0.0)z=(x-2)/(y*y+1); if (x<0.0)z=x+y; printf("z=%f ",z);}
不会啊,注意数据输入格式(必须用空格分开)