Перевести программу на язык Python #include "iostream"
using namespace std; int main()
{ double x,y,z,R1,R2; cout << "R1 < R2 : ";
cin >> R1 >> R2; R1*=R1; R2*=R2; for(int k=1; k <= 10; k++) { cout << "x y > "; cin >> x >> y; z=x*x+y*y; if (x < 0&& y > 0&& z < R1||x > 0&& y <0 && z > R1&& z < R2) cout << "Hit the Target\n"; else
cout << "Missed the Mark\n"; } }
Код:
R1, R2 = (float(i) for i in input("R1 < R2 : ").split())
R1 *= R1
R2 *= R2
for k in range(1, 10):
x, y = (float(i) for i in input("x y > ").split())
z = x*x + y*y
if (x < 0 and y > 0 and z < R1) or (x > 0 and y < 0 and z > R1 and z < R2):
print("Hit the Target")
else:
print("Missed the Mark")