Advertisement
Guest User

Untitled

a guest
Feb 7th, 2016
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.65 KB | None | 0 0
  1. #include <iostream>
  2. #include <math.h>
  3. #include <cstdlib>
  4. #include <math.h>
  5. using namespace std;
  6. double dlugosc;
  7. int ile;
  8. struct kolo{
  9.     int x;
  10.     int y;
  11.     int r;
  12.    
  13. };
  14.  
  15. kolo c ={4,6,7};
  16.  
  17. struct punkt{
  18.     int x1;
  19.     int y1;
  20.  
  21. };
  22.  
  23.  
  24. struct punkt Tab[5]={
  25.     {3,2},
  26.     {2,6},
  27.     {3,4},
  28.     {3,8},
  29.     {3,2}
  30. };
  31.  
  32.  
  33. int czywokregu( struct punkt Tab[5], kolo c, double dlugosc,int ile)
  34. {
  35.    
  36.     for(int i=0; i<5; i++)
  37.     {
  38.       dlugosc = sqrt((Tab[i].x1 - c.x)^2 +(Tab[i].y1 - c.y)^2) ;
  39.       if(dlugosc<c.r)
  40.       ile++;
  41.        
  42.        
  43.        
  44.     }
  45.     return ile;
  46. }
  47.  
  48. int main()
  49.  
  50. {
  51. cout<<czywokregu;
  52.  
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement