Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- #include <cstdlib>
- #include <math.h>
- using namespace std;
- double dlugosc;
- int ile;
- struct kolo{
- int x;
- int y;
- int r;
- };
- kolo c ={4,6,7};
- struct punkt{
- int x1;
- int y1;
- };
- struct punkt Tab[5]={
- {3,2},
- {2,6},
- {3,4},
- {3,8},
- {3,2}
- };
- int czywokregu( struct punkt Tab[5], kolo c, double dlugosc,int ile)
- {
- for(int i=0; i<5; i++)
- {
- dlugosc = sqrt((Tab[i].x1 - c.x)^2 +(Tab[i].y1 - c.y)^2) ;
- if(dlugosc<c.r)
- ile++;
- }
- return ile;
- }
- int main()
- {
- cout<<czywokregu;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement