大家找错!
#include<iostream.h>#include<math.h>
#define Pi 3.1415926
class point
{
public:
double x;
double y;
double x0;
double y0;
point()
{
cout<<"请输入一个横坐标:";cin>>x0;
cout<<"请输入一个纵坐标:";cin>>y0;
}
void disp()
{
cout<<"\t坐标:("<<x0<<","<<y0<<")";
}
};
class circle
{
public:
double x1;
double y1;
double r;
int sum;
int count;
double s;
circle()
{
cout<<"请输入园的横坐标:";cin>>x1;
cout<<"请输入园的纵坐标:";cin>>y1;
cout<<"请输入半径:";cin>>r;
}
void disp()
{
sum=0;count=0;
cout<<"\t园坐标:("<<x1<<","<<y1<<")";
cout<<"\t面积:"<<Pi*r*r;
if(r>s)
{
cout<<"\t距离是"<<sqrt((point.x0-x1)*(point.y0-y1)+(point.x0-x1)*(point.y0-y1));cout<<endl;
cout<<"\t点在圆心内"<<endl;
sum++;
}
else
{
cout<<"\t距离是0";cout<<endl;
cout<<"\t点不在圆心内"<<endl;
}
}
friend bool puanduan(circle r,circle s)
{
}
};
void main()
{
char flag;
int count=0;
int sum=0;
do
{
point p;
circle c;
p.disp();
c.disp();
if(c.r>c.s)
{
sum++;
}
count++;
cout<<"继续判断?";cin>>flag;
}while(flag!='n');
cout<<"判断了"<<count<<"次"<<"包含"<<sum<<"次."<<endl;
}
红色地方出错了 怎么会的?
[[it] 本帖最后由 happycplusplus 于 2008-10-14 20:46 编辑 [/it]]