原先做的东西 出现“'__****'在模块” 语法错误
#include
main()
{
float x,y;
printf("Input the coordinate of a point\n");
printf("x=");
scanf("%f",&x);
printf("y=");
scanf("%f",&y);
if(x==0)
if(y>0)
printf("The point is at the Y zhengbanzou");
else
if(y==0)
printf("The point is at the yuandian");
else
printf("The point is at the Y fubanzou");
else
if(x>0)
if(y>0)
printf("The point is in 1st quadrant.\n");
else
if(y==0)
printf("The point is at the X zhengbanzou");
else
printf("The point is in 4st quadrant.\n");
else
if(y>0)
printf("The point is in 2st quadrant.\n");
else
if(y==0)
printf("The point is at the X zhengbanzou");
else
printf("The point is in 3st quadrant.\n");
getch();
}
改了之后
#include
main()
{
float x,y;
printf("Input the coordinate of a point.\n");
printf("x=");
scanf("%f",&x);
printf("y=");
scanf("%f",&y);
if(x==0)
{if(y>0)
printf("The point is at the Y zhengbanzou.\n");
else
{if(y==0)
printf("The point is at the yuandian.\n");
else
printf("The point is at the Y fubanzou.\n");}}
else
if(x>0)
{if(y>0)
printf("The point is in 1st quadrant.\n");
else
if(y==0)
printf("The point is at the X zhengbanzou.\n");
else
printf("The point is in 4st quadrant.\n");}
else
{if(y>0)
printf("The point is in 2st quadrant.\n");
else
{if(y==0)
printf("The point is at the X fubanzou.\n");
else
printf("The point is in 3st quadrant.\n");}}
getch();
}
本文分享了一段C语言程序,用于根据输入的坐标点判断该点所在象限,并修复了其中的语法错误。
1359

被折叠的 条评论
为什么被折叠?



