ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1409. Two Gangsters

1409 Runtime Error
Posted by Nitchakarn 25 Jun 2015 10:06
Dear All,

I am a student and I got an assignment from my teacher to run "1409 Two Gangsters". I write Python program v.2.7 as per following codes. I run the program many times, but it still showed "Runtime Error". I could not fix it.

It would be appreciated if someone can help me. Thanks.


# 1409 Two Gangsters (Created: 24th June 2015 / Python 2.7)


# -------------------- Start of Program -------------------- #

# Set initial values
total = 0    # total number of cans shot by Harry and Larry
Harry = 0    # the number of cans shot by Harry
Larry = 0    # the number of cans shot by Larry
h = 0            # the number of cans that were not shot by Harry
l = 0           # the number of cans that were not shot by Larry


Harry = int(input("Please enter the number of cans shot by Harry: ")
Larry = int(input("Please enter the number of cans shot by Larry: ")


# Calculation of "The number of cans that were not shot by Harry and Larry"
total = Harry + Larry -1
h = total - Harry
l = total - Larry


# Output
print "-"*100
print "Total number of cans are : ", total
print "The number of cans that were not shot by Harry and Larry are ", h, "and", l, "respectively."
print "-"*100




# -------------------- End of Program -------------------- #