Why output of my code is in wrong format?
Dadkhah · 2016-03-09 22:37:12
#include <iostream>
using namespace std;
int main(int argc, char* argv[])
{
while(true){
float x,y,r;
int c,res=0;
cin>>x>>y>>r;
if(r<0)
break;
cin>>c;
for (int i = 0; i < c; i++)
{
float a,b;
cin>>a>>b;
if((a-x)*(a-x)+(b-y)*(b-y)<=r*r)
res++;
}
cout<<res<<endl;
}
return 0;
}
Ln (x) dx · 2016-03-10 17:40:03
Because we have no circle in the problem. You have counted number of points in the radious range of the given circle.
Ln (x) dx · 2016-03-15 19:51:09
We have a semi-circle that turns around its center.
mars! · 2016-04-11 12:21:02
becuase your code is wrong
pages:
- 1