fork(5) download
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. double a,b;
  8. scanf("%lf %lf", &a, &b);
  9. for (int x =-a; x <= a; x++){
  10. for (int y = -b; y <= b; y++){
  11. if ( (x*x)/(a*a)+(y*y)/(b*b) <= 1 )
  12. printf("(%d,%d)\n", x, y);
  13.  
  14. }}
  15. return 0;
  16. }
Success #stdin #stdout 0s 3344KB
stdin
3
2
stdout
(-3,0)
(-2,-1)
(-2,0)
(-2,1)
(-1,-1)
(-1,0)
(-1,1)
(0,-2)
(0,-1)
(0,0)
(0,1)
(0,2)
(1,-1)
(1,0)
(1,1)
(2,-1)
(2,0)
(2,1)
(3,0)