Advertisement
Guest User

Untitled

a guest
Sep 14th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3. #pragma warning(disable : 4996)
  4.  
  5.  
  6. void main()
  7. {
  8. int b = 0, m = 0, w = 0, out = 0;
  9. float x, y;
  10. do
  11. {
  12. printf("Unesite koordinate tacke:");
  13. scanf("%f%f", &x, &y);
  14. if ((x - 3)*(x - 3) + (y - 3)*(y - 3) <= 4 && (x - 3)*(x - 3) + (y - 3)*(y - 3)>1)
  15. //SECE KRUG PRAVI PRSTEN
  16. b++;
  17. else if ((x - 3)*(x - 3) + (y - 3)*(y - 3) <= 1 && x<3 && y>3)
  18. m++;
  19. else if ((x - 3)*(x - 3) + (y - 3)*(y - 3) <= 1 && x>3 && y<3)
  20. w++;
  21. else
  22. out++;
  23.  
  24. printf("b=%d , M=%d , W= %d , Van=%d ", b, m, w, out);
  25. } while (b + m + w >= out);
  26. printf("Oblast B:%d\nOblast M:%d\nOblast W:%d\n", b, m, w);
  27. getch();
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement