本題要求從鍵盤輸入一個字符串,判斷該串是否屬於整數、浮點數或者復數的表示
輸入格式:
輸入一個字符串
輸出格式:
輸出yes或no
輸入樣例:
-299
輸出樣例:
yes
a = input() try: a = eval(a) if type(a) == int or type(a) == float or type(a) == complex: print('yes') else: print('no') except: print("no")