Guest User

Untitled

a guest
Dec 6th, 2019
87
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<iostream>
  2. #include<cmath>
  3. using namespace std;
  4. int main(){
  5. int n,x,y,z,t,S,a,b,c,d;
  6. cout<<"nhap n = "; cin>>n;
  7. S=0;
  8. for (int i=1;i<=n;i++)
  9. {
  10. cout<<"Hinh "<<i<<endl;
  11. cout<<"Toa do tam O"<<endl;
  12. cout<<" x = "; cin>>x;
  13. cout<<" y = ";cin>>y;
  14. cout<<"Toa do diem A"<<endl;
  15. cout<<" x = "; cin>>z;
  16. cout<<" y = ";cin>>t;
  17.  
  18. if (sqrt(pow(x-z,2)+pow(y-t,2))>S)
  19. {
  20. S=sqrt(pow(x-z,2)+pow(y-t,2));
  21. a=x;b=y;c=z;d=t;
  22. }
  23.  
  24. }
  25. cout<<"Duong tron lon nhat co tam O("<<a<<","<<b<<")"<<" va diem A("<<c<<","<<d<<")";
  26.  
  27.  
  28. }
RAW Paste Data