ENG  RUSTimus Online Judge
Online Judge
Задачи
Авторы
Соревнования
О системе
Часто задаваемые вопросы
Новости сайта
Форум
Ссылки
Архив задач
Отправить на проверку
Состояние проверки
Руководство
Регистрация
Исправить данные
Рейтинг авторов
Текущее соревнование
Расписание
Прошедшие соревнования
Правила
вернуться в форум

Обсуждение задачи 1409. Два бандита

1409 Runtime Error
Послано Nitchakarn 25 июн 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 -------------------- #