daily pastebin goal
50%
SHARE
TWEET

Untitled

a guest Sep 14th, 2018 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top