Advertisement
Guest User

Untitled

a guest
Feb 19th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. int solution(int N) {
  2. // write your code in C++14 (g++ 6.2.0)
  3. int count=0;
  4. for (int x=0;x<=N;x++)
  5. {
  6. for (int y=0; y<=N;y++)
  7. {
  8. if(x*x+y*y<=N*N) count++;
  9. }
  10. }
  11.  
  12. return (4*count-4*N-3);
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement