摘要: def drawsquare(num): a=int(num**0.5) for i in range(a): print(a"+ "+"+") for j in range(3): print(a"| "+"|") print(a"+ "+"+") n=eval(input("请输入正整数:")) 阅读全文
posted @ 2025-04-20 20:44 城阳 阅读(16) 评论(0) 推荐(0)
摘要: import decimal from decimal import Decimal import time def calculate_pi(iterations, progress_callback=None): # 设置足够的计算精度(根据迭代次数调整) decimal.getcontext( 阅读全文
posted @ 2025-04-13 20:07 城阳 阅读(41) 评论(0) 推荐(0)
摘要: 习题4.1 target = 425 guess = 0 F = 1 while guess != target: guess = eval(input("请输入一个猜测的整数(1至1000):")) if guess > target: print("猜大了") F += 1 elif guess 阅读全文
posted @ 2025-04-06 17:45 城阳 阅读(19) 评论(0) 推荐(0)
摘要: 3.19 import time t = time.gmtime() print(time.strftime("%Y-%m-%d",t)) 3.20 import time current_time = time.localtime() format1 = time.strftime("%Y年%m月 阅读全文
posted @ 2025-03-30 19:07 城阳 阅读(7) 评论(0) 推荐(0)
摘要: intial_weight = 50 weight_gain = 0.5 moon_weight_ratio = 0.165 print("年份\t地球体重(kg)\t月球体重(kg)") for year in range(1,11): earth_weight = intial_weight + 阅读全文
posted @ 2025-03-23 19:30 城阳 阅读(8) 评论(0) 推荐(0)
摘要: 2.1 tempConvert.py TempStr = input("请输入带有符号的温度值:") if TempStr[-1] in ['F', 'f']: C = (float(TempStr[0:-1]) - 32) / 1.8 print("转换后的温度是{:.0f}C".format(C 阅读全文
posted @ 2025-03-16 19:52 城阳 阅读(8) 评论(0) 推荐(0)
摘要: TempStr = input("请输入带有符号的温度值:") if TempStr[-1] in ['f','F']: C = (eval(TempStr[0:-1]) - 32)/1.8 print("转化后的温度是{:.2f}C".format(C)) elif TempStr[-1] in 阅读全文
posted @ 2025-03-16 19:49 城阳 阅读(17) 评论(0) 推荐(0)
摘要: 一、引言 近年来,人工智能领域取得了突破性进展,其中大模型(Large Language Models, LLMs)作为最具代表性的技术之一,展现出强大的语言理解和生成能力,并在各个领域得到广泛应用。从GPT-4到百度文心一言等,这些模型展现出强大的语言理解与生成能力,广泛应用于内容创作、智能客服、 阅读全文
posted @ 2025-03-09 14:08 城阳 阅读(231) 评论(0) 推荐(0)
摘要: str1 = input("请输入一个人的名字") str2 = input("请输入一个国家的名字") print("世界这么大,{} 想去 {} 看看 ." .format(str1,str2)) n = input("请输入整数N:") sum = 0 for i in range(int(n 阅读全文
posted @ 2025-03-09 14:02 城阳 阅读(17) 评论(0) 推荐(0)