Advertisement
Guest User

a_p

a guest
Nov 18th, 2019
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.71 KB | None | 0 0
  1. x=input().split()
  2. r=float(x[0]) #raza
  3. a=float(x[1]) #acceleratia
  4. N=int(x[2]) #nr de linii
  5. m_p=1.67e-27
  6. m_e=9.11e-31
  7. mase=[]
  8. necunoscute=0
  9. for i in range(N):
  10.     E=float(input())
  11.     #d = 1.5 * 3.1415 * r * (10e3)
  12.     #v_patrat = 2 * a * d
  13.     #m=2*E/v_patrat
  14.     m=E/(1.5*3.1415*r*10e2*a)
  15.  
  16.     if m>(m_e-0.1*m_e) and m<(m_e+0.1*m_e):
  17.         m_modificat=m*pow(10,31)
  18.         mase.append("%.6fe-31"%round(m_modificat,6))
  19.     elif m>(m_p-0.1*m_p) and m<(m_p+0.1*m_p):
  20.         m_modificat=m*pow(10,27)
  21.         mase.append("%.6fe-27"%round(m_modificat,6))
  22.     else:
  23.         necunoscute+=1
  24.  
  25. for i in mase:
  26.     print(i)
  27.  
  28. probabilitate_nescunoscute=necunoscute/N
  29. print("%.4f"%probabilitate_nescunoscute)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement