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
229 390
Sample Output1
Hard
Sample Input2
123456789 9876543218
Sample Output2
Easy
l=0
while(l!=2):
s = (str(input("Enter two numbers separated by space: "))).split(" ")
l = len(s)
Flag=0
for r in range(0,len(s[0])):
t1 = int(s[0][r])
t2 = int(s[1][r])
if((t1+t2)>9): Flag=1
if(Flag): print("HARD")
else: print("EASY")
Comments
Leave a comment