Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <cstdlib>
  3. #include <iostream>
  4.  
  5. int foo(double a, double b, double x, double y)
  6. {
  7. return ((x*x)/(a*a) + (y*y)/(b*b));
  8. }
  9.  
  10. int main ()
  11. {
  12. int b = 6, a = 10;
  13. const int min = -15, max = 15;
  14. int x = min, y = min;
  15. for (; y < max; ++y)
  16. {
  17. for (x = min; x < max; ++x)
  18. std::cout << (foo(a,b,x,y) == 1 ? '*' : '#');
  19. std::cout << std::endl;
  20. }
  21. system("PAUSE");
  22. return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement