题目:有4个正方形塔,中心分别为(2,2),(-2,2),(2,-2),(-2,-2),边长均为2,高度为10,塔外高度为0.今输入一坐标,求该点的建筑高度.
我写的:
main() { int h; float x,y; printf("input one number:"); scanf("%f,%f",&x,&y); if(-3<=x<=-1&&1<=y<=3||-3<=x<=-1&&-3<=y<=-1||1<=x<=3&&-3<=y<=-1||1<=x<=3&&1<=y<=3) h=10; else h=0; printf("The height of construction is %d\n",h); }
我觉得没错啊,但在TC下调试结果不对.(我输入任何两个数字,出来都是10)
我刚开始学C,望大家帮我看看,谢谢了
[此贴子已经被作者于2004-10-05 23:57:55编辑过]