Difficult Addition
Arjun is trying to add two numbers. Since he has learned addition recently, an addition which requires a carry is difficult for him. Your task is to print Easy if the addition does not involve a carry, Otherwise print Hard.
Input
The first line of input contains two space separated integers A and B.
Output
If the addition does not involve a carry,print Easy, otherwise print Hard.
Explanation
When calculating 229 + 390, we have a carry from the tens digit to the hundreds digit, so the answer is Hard.
Sample Input1
123456789 9876543218
Sample Output1
Easy
Sample Input2
229 390
Sample Output2
Hard
n=0
while(n!=2):
input1 = (str(input("Enter two numbers separated by space: "))).split(" ")
n = len(input1)
s_1=0
for s in range(0,len(input1[0])):
t1 = int(input1[0][s])
t2 = int(input1[1][s])
if((t1+t2)>9):
s_1=1
if(s_1):
print("HARD")
else:
print("EASY")
Enter two numbers separated by space: 240 300
EASY
Comments
Leave a comment