求助:编写一个c++程序,提示用户输入一个点(x,y)——

2025-05-17 20:12:53
推荐回答(4个)
回答1:

#include 
#include 
using namespace std;
int main()
{
float x,y,distance;
cout<<"(x,y)=";
cin>>x>>y;
distance=sqrt(x*x+y*y);
if(distance>10)
cout<<"("< else if(distance == 10)
cout<<"("< else
cout<<"("< return 0;
}

//示例运行结果
F:\c++_work>a.exe
(x,y)=4 5
(4,5)在圆内

F:\c++_work>a.exe
(x,y)=9 9
(9,9)在圆外

回答2:

#include
int main()
{
int x,y;
scanf("d%,d%",&x,&y); //输入坐标
printf("(%d,%d)", x,y ); //输出坐标

if
x>10 or y>10; //判断是否在圆内
printf("不在圆内");
else
printf("在圆内");
return(0);
}

回答3:

#include
int main(void)
{
int x,y,l;
scanf("%d%d",&x,&y);
l=x*x+y*y;
if(l>100)
printf("该点在圆外");
else
printf("该点在圆内");
}

回答4:

输入一个点