Nguyen Trung Hieu
Tổng số bài gửi : 28 Join date : 01/08/2022
| Tiêu đề: Re: Nguyễn Trung Hiếu Sun Aug 07, 2022 3:56 pm | |
| - Code:
-
from math import sqrt x1 = int(input('nhap x1=')) y1 = int(input('nhap y1=')) x2 = int(input('nhap x2=')) y2 = int(input('nhap y2=')) r = int(input('nhap r=')) c1=(x1-x2) c2=(y1-y2) h1=pow(c1,2) h2=pow(c2,2) d=sqrt(h1+h2) if d>r: print('M nam ngoai duong tron') else: print('M nam trong duong tron')
| |
|
Nguyen Trung Hieu
Tổng số bài gửi : 28 Join date : 01/08/2022
| Tiêu đề: Re: Nguyễn Trung Hiếu Sun Aug 07, 2022 4:06 pm | |
| - Code:
-
from math import sqrt def dodai(a,b,c,d): c1 = (a - c) c2 = (b - d) d1 = pow(c1, 2) d2 = pow(c2, 2) h0 = sqrt(d1 + d2) return h0 x1=int(input('nhap x1=')) y1=int(input('nhap y1=')) x2=int(input('nhap x2=')) y2=int(input('nhap y2=')) x3=int(input('nhap x3=')) y3=int(input('nhap y3='))
h1= dodai(x1,y1,x2,y2) h2= dodai(x2,y2,x3,y3) h3= dodai(x1,y1,x3,y3) if (h1+h1>h3) and (h1+h3>h2) and (h2+h3>h1): d = h1 + h2 + h3 p = d / 2 s = sqrt(p * (p - h1) * (p - h2) * (p - h3)) print ('s={:.3f}'.format(s)) else: print('a,b,c khong la ba canh cua tam giac') | |
|
Nguyen Trung Hieu
Tổng số bài gửi : 28 Join date : 01/08/2022
| Tiêu đề: Re: Nguyễn Trung Hiếu Sun Aug 07, 2022 11:22 pm | |
| - Code:
-
a = int(input('nhap a=')) b = int(input('nhap b=')) c = int(input('nhap c='))
m=a*100+b*10+c n=a*100+c*10+b p=b*100+a*10+c j=b*100+c*10+a q=c*100+b*10+a k=c*100+a*10+b
res=m if (res<n) : res=n if (res<p) : res=p if (res<j) : res=j if (res<q) : res=q if (res<k) : res=k print(res) | |
|
Nguyen Trung Hieu
Tổng số bài gửi : 28 Join date : 01/08/2022
| Tiêu đề: Re: Nguyễn Trung Hiếu Sun Aug 07, 2022 11:45 pm | |
| - Code:
-
from math import sqrt xm = int(input('nhap xm=')) ym = int(input('nhap ym=')) x1 = int(input('nhap x1=')) y1 = int(input('nhap y1=')) x3 = int(input('nhap x3=')) y3 = int(input('nhap y3=')) if (ym<y1) and (ym>y3) and (xm>x1) and (xm<x3): print ('M nam trong hinh chu nhat') else: print('M khong nam trong hinh chu nhat') | |
|
Sponsored content
| Tiêu đề: Re: Nguyễn Trung Hiếu | |
| |
|