name=input('请输入你的名字，回车结束：')
birthday = float(input('请输入你的出生日期（如5月20日，则输入5.20），按下回车键结束：'))

if 3.21<= birthday <=3.31 or 4.1<= birthday <=4.19:
    print(name,'你是热情自信的白羊座喔！',sep='!')
    
elif 4.20<= birthday <= 4.30 or 5.1<= birthday <=5.20:
    print(name,'你是固执又有韧性的金牛座喔！',sep='!')
    
elif 5.21<= birthday <=5.31 or 6.1<= birthday <=6.21:
    print(name,'你是充满好奇心又多变的双子座喔！',sep='!')
    
elif 6.22<= birthday <=6.30 or 7.1<= birthday <=7.22:
    print(name,'你是敏锐又体贴的巨蟹座喔！',sep='!')
    
elif 7.23<= birthday <=7.31 or 8.1<= birthday <=8.22:
    print(name,'你是霸道又慷慨的狮子座喔！',sep='!')
    
elif 8.23<= birthday <=8.31 or 9.1<= birthday <=9.22:
    print(name,'你是具有完美主义的处女座喔！',sep='!')
    
elif 9.23<= birthday <=9.30 or 10.1<= birthday <=10.23:
    print(name,'你是优雅又追求和平的天秤座喔！',sep='!')
    
elif 10.24<= birthday <=10.31 or 11.1<= birthday <=11.22:
    print(name,'你是冷酷又神秘的天蝎座喔！',sep='!')
    
elif 11.23<= birthday <=11.30 or 12.1<= birthday <=12.21:
    print(name,'你是热爱自由又粗心的射手座喔！',sep='!')
    
elif 12.22<= birthday <=12.31 or 1.1<= birthday <=1.19:
    print(name,'你是稳重严肃的摩羯座喔！',sep='!')
    
elif 1.20<= birthday <=1.31 or 2.1<= birthday <=2.18:
    print(name,'你是智慧又叛逆的水瓶座喔！',sep='!')
    
elif 2.19<= birthday <=2.29 or 3.1<= birthday <=3.20:
    print(name,'你是喜欢幻想又多情的双鱼座喔！',sep='!')
    
else:
    print(name,'你一定是在乱输数字逗我玩~',sep=',')

"""
Explanation: 练习 1：写程序，可由键盘读入用户姓名例如Mr. right，让用户输入出生的月份与日期，判断用户星座，假设用户是金牛座，则输出，Mr. right，你是非常有性格的金牛座！。
End of explanation
"""


m = int(input('请输入一个整数，按下回车键结束：'))
n = int(input('请输入一个不为0的整数，按下回车键结束：'))
ask = input('你想让这两个数做什么运算？（如：求和、乘积、余数），回车结束：')

if ask == '求和':
    if m<n:
        sum = n    
        while m<n:
            sum = sum+m
            m = m+1
    
    elif n<m:
        sum = m
        while n<m:
            sum = sum+n
            n = n+1
            
    elif m==n:
        sum=m+n
        
    print(sum)
    
elif ask == '乘积':
    if m<n:
        product = n
        while m<n:
            product *= m
            m = m+1
    
    elif n<m:
        product = m
        while n<m:
            product *= n
            n = n+1
    
    elif m==n:
        product =m*n

    print(product)

elif ask == '余数':
    remainder=m%n
    print(remainder)

else:
    print(m//n)

        
        
        

"""
Explanation: 练习 2：写程序，可由键盘读入两个整数m与n(n不等于0)，询问用户意图，如果要求和则计算从m到n的和输出，如果要乘积则计算从m到n的积并输出，如果要求余数则计算m除以n的余数的值并输出，否则则计算m整除n的值并输出。
End of explanation
"""


AQI = int(input('请输入今天的北京雾霾PM2.5指数，回车结束：'))

if AQI>500:
    print('今天空气污染十分严重，应避免出门，在室内应该打开空气净化器，如出门一定要戴上防雾霾口罩喔！')
elif 200<= AQI <=500:
    print('今天空气污染严重，出门记得戴上防雾霾口罩喔~')
elif 100<= AQI <200:
    print('今天空气轻度污染，也要把口罩带在身上以防喉咙不适喔~')
elif 50<= AQI <100:
    print('今天空气质量良好，可以进行户外活动~')
elif AQI<50:
    print('今天空气质量优良，抓紧时间到户外活动吧！')

"""
Explanation: 练习 3：写程序，能够根据北京雾霾PM2.5数值给出对应的防护建议。如当PM2.5数值大于500，则应该打开空气净化器，戴防雾霾口罩等。
End of explanation
"""


word = str(input('Please type in an English word(singular form):'))

if word.endswith('s') or word.endswith('sh') or word.endswith('ch') or word.endswith('x'):
    print(word,'es',sep ='')
elif word.endswith('y'):
    print('若该单词为 辅音字母加y结尾，去掉y加ies；否则直接加s')
elif word == 'hero'or word == 'negro' or word =='potato' or word =='tamato':
    print(word,'es',sep='')
elif word=='half'or word =='knife' or word =='leaf' or word == 'wolf' or word == 'wife'or word =='life' or word=='thief':
    print('去掉f或fe加ves')
else:
    print(word,'s',sep ='')
    

"""
Explanation: 练习 4：英文单词单数转复数，要求输入一个英文动词（单数形式），能够得到其复数形式，或给出单数转复数形式的建议（提示，some_string.endswith(some_letter)函数可以判断某字符串结尾字符，可尝试运行：'myname'.endswith('me')，'liupengyuan'.endswith('n')`）。
End of explanation
"""


name = input('请输入你的名字，回车键结束：')
print()
print('你好',name,sep = '!')


print('空行在下面')
print('空行真的在下面')
print()
print('空行在上面')
print('没骗你吧空行真的在上面')

"""
Explanation: 尝试性练习：写程序，能够在屏幕上显示空行。
End of explanation
"""


n = int(input('请输入要输入的整数个数，按下回车键结束：'))

max_num = int(input('请输入一个整数，回车结束'))
submax = 0

i = 1
while i < n:
    i += 1
    x = int(input('请输入一个整数，回车结束'))
    if x > max_num:
        submax = max_num
        max_num = x
        
    elif x < max_num and x > submax:
        submax = x
        
print('次大值是：', submax)

"""
Explanation: 挑战性练习：写程序，由用户输入一些整数，能够得到几个整数中的次大值(第二大的值)并输出。
End of explanation
"""


