#include <stdio.h>
int main() {
printf("祝福各位驾照快快考出\n\n");
// 练习一下循环的使用
int i;
for (i=1; i<=100; i++) {
printf("祝福各位驾照快快考出 %d 次\n", i);
}
printf("\n\n绘制一个心形图案:");
......................
阅读全部
|
明月诱人
贴于 2023年7月21日 23:10
hide
bbsi
#include <stdio.h>
int main() {
printf("祝福各位驾照快快考出\n\n");
// 练习一下循环的使用
int i;
for (i=1; i<=100; i++) {
printf("祝福各位驾照快快考出 %d 次\n", i);
}
printf("\n\n绘制一个心形图案:");
......................
阅读全部
|
明月诱人
贴于 2023年7月21日 23:10
hide
bbsi
import openai
# 設置OpenAI API的密鑰
openai.api_key = '11'
# 定義聊天模型的輸入提示
def get_chat_response(prompt):
response = openai.Completion.create(
engine='text-davinci-003', # 指定使用的模型
prompt=prompt,
max_tokens=50 # 生成聊天回復的最大長度
)
......................
阅读全部
|
晏晴
贴于 2023年7月20日 22:51
hide
bbsi
class Alpaca:
def __init__(self, name, age):b I’m
self.name = 你爹
self.age = 12
def introduce(self):
print(f"你好,我叫{self.name} ,現在 {self.age} 歲.")
阅读全部
|
晏晴
贴于 2023年7月20日 22:29
hide
bbsi
#include <iostream>
#include <string>
// 函數:回答用戶的問題
std::string respond(const std::string& question) {
// 在這裡添加你的回答邏輯
// 你可以使用條件語句、函數等來組織你的邏輯
// 簡單示例:回答固定的問候語
if (question == "你好") {
return "你好,有什麼我可以幫助你的嗎?";
}
......................
阅读全部
|
晏晴
贴于 2023年7月19日 18:37
hide
bbsi
name = input("請輸入您的名字:")
print("您好," + name + "!")
if len(name) > 5:
print("您的名字很長!")
else:
print("您的名字很短!")
for i in range(5):
print("迴圈運行次數:" + str(i+1))
阅读全部
|
晏晴
贴于 2023年7月19日 18:34
hide
bbsi
# https://www.luogu.com.cn/problem/P5710
"""
如果你还记得 True 转成 int 参与 + 运算对应自动转化为 1,False 自动转化为 0,下列代码可简单写为
q = 0
if A + B == 2:
q = 1
w = 0
......................
阅读全部
|
sunsongwei
贴于 2023年7月17日 21:35
hide
bbsi
# https://www.luogu.com.cn/problem/P5710
x = int(input())
# 条件1 的结果保存到 变量 A 中
A = (x % 2 == 0)
# 条件2 的结果保存到 变量 B 中
......................
阅读全部
|
sunsongwei
贴于 2023年7月17日 21:35
hide
bbsi
for i in range(2):
table={0:'0',1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"A",11:"B",12:"C",13:"D",14:"E",15:"F"}
def DtoH(num):
if num<=0:
return ''
y=num%16
return DtoH(num//16)+table[y]
num=int(input('请输入一个十进制的数字:'))
print(f"十六进制:{DtoH(num)}")
print('代码运行成功\n退出')
阅读全部
|
ambulance
贴于 2023年7月17日 10:54
hide
bbsi
screen = turtle.Screen()
screen.bgcolor("black")
def create_firework():
colors = ["red", "orange", "yellow", "green", "blue", "purple", "white"]
firework = turtle.Turtle()
firework.shape("circle")
firework.color(random.choice(colors))
firework.shapesize(0.5)
firework.penup()
firework.speed(0)
firework.goto(random.randint(-200, 200), -200)
......................
阅读全部
|
文清清
贴于 2023年7月7日 17:07
hide
bbsi