Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def simple():
- e=f=g=u=m=ppp=ppz=""
- s=" "
- pp=pz=0
- a=int(input("Inserisci Primo Numero: "))
- b=int(input("Inserisci Secondo Numero: "))
- if a<0:
- s="-"
- a=a*-1
- if b<0:
- s="-"
- b=b*-1
- if a<b:
- x=a
- e=len(str(b))
- else:
- x=b
- e=len(str(a))
- while True:
- if a%x==0 and b%x==0:
- break
- x=x-1
- c=a/x
- d=b/x
- if c<d:
- u=c
- k=len(str(d))
- else:
- u=d
- k=len(str(c))
- for o in range(e):
- g=g+"-"
- for ok in range(k):
- m=m+"-"
- if a>b:
- pp=len(str(a))-len(str(b))
- else:
- pz=len(str(b))-len(str(a))
- for cy in range(pp):
- ppp=ppp+" "
- for cyl in range(pz):
- ppz=ppz+" "
- j=" "+str(a)+ppz+" "+str(c)
- jj=s+" "+g+" = "+s+" "+m
- jjj=" "+str(b)+ppp+" "+str(d)
- print(j)
- print(jj)
- print(jjj)
- while True:
- simple()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement