fork download
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7. float mx,mn=0.0f;
  8.  
  9. for(float x=-10.0f; x<10.0f; x+=0.01f)
  10. {
  11. for(float y=-10.0f; y<10.0f; y+=0.01f)
  12. {
  13. float a=atan2f(y,x);
  14. mx=std::max(mx,a);
  15. mn=std::min(mn,a);
  16. }
  17. }
  18.  
  19. std::cout << "Min:" << mn << " Max: " << mx << std::endl;
  20. return 0;
  21. }
Success #stdin #stdout 0.12s 4520KB
stdin
Standard input is empty
stdout
Min:-3.14061 Max: 3.14158