Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- #pragma warning(disable : 4996)
- void main()
- {
- int b = 0, m = 0, w = 0, out = 0;
- float x, y;
- do
- {
- printf("Unesite koordinate tacke:");
- scanf("%f%f", &x, &y);
- if ((x - 3)*(x - 3) + (y - 3)*(y - 3) <= 4 && (x - 3)*(x - 3) + (y - 3)*(y - 3)>1)
- //SECE KRUG PRAVI PRSTEN
- b++;
- else if ((x - 3)*(x - 3) + (y - 3)*(y - 3) <= 1 && x<3 && y>3)
- m++;
- else if ((x - 3)*(x - 3) + (y - 3)*(y - 3) <= 1 && x>3 && y<3)
- w++;
- else
- out++;
- printf("b=%d , M=%d , W= %d , Van=%d ", b, m, w, out);
- } while (b + m + w >= out);
- printf("Oblast B:%d\nOblast M:%d\nOblast W:%d\n", b, m, w);
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement