mol = 0while 1: try: mol = mol + 1 fp, fh = map(int,input().split()) l = int(fp*5/2 + fh*3) a = 2 + l - fp - fh print('Molecula #%d.:.' % mol) print('Possui %d atomos e %d ligacoes' % (l, a)) print() except: break
12 20 50 120 10025 548 468 17458
Molecula #1.:. Possui 90 atomos e 60 ligacoes Molecula #2.:. Possui 485 atomos e 317 ligacoes Molecula #3.:. Possui 26706 atomos e 16135 ligacoes Molecula #4.:. Possui 53544 atomos e 35620 ligacoes
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!