Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- struct cr{
- int x,y,r;
- };
- int main(){
- cr a,b;
- double d;
- cin>>a.x>>a.y>>a.r;
- cin>>b.x>>b.y>>b.r;
- d=(a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y);
- if(a.x==b.x && a.y==b.y && a.r==b.r)
- cout<<-1;
- else
- if((a.r+b.r)*(a.r+b.r)==d || (a.r-b.r)*(a.r-b.r)==d)
- cout<<1;
- else
- if((a.r+b.r)*(a.r+b.r)<d || (a.r-b.r)*(a.r-b.r)>d)
- cout<<0;
- else
- cout<<2;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement