Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<cmath>
- using namespace std;
- int main(){
- int n,x,y,z,t,S,a,b,c,d;
- cout<<"nhap n = "; cin>>n;
- S=0;
- for (int i=1;i<=n;i++)
- {
- cout<<"Hinh "<<i<<endl;
- cout<<"Toa do tam O"<<endl;
- cout<<" x = "; cin>>x;
- cout<<" y = ";cin>>y;
- cout<<"Toa do diem A"<<endl;
- cout<<" x = "; cin>>z;
- cout<<" y = ";cin>>t;
- if (sqrt(pow(x-z,2)+pow(y-t,2))>S)
- {
- S=sqrt(pow(x-z,2)+pow(y-t,2));
- a=x;b=y;c=z;d=t;
- }
- }
- cout<<"Duong tron lon nhat co tam O("<<a<<","<<b<<")"<<" va diem A("<<c<<","<<d<<")";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement