新春快乐(烟花、春联)【附源码】

news2025/5/21 5:35:50

新春快乐

  • 一: `C语言` -- 烟花
  • 二:`Python` -- 春联
  • 三:`Python` -- 烟花
  • 四:`HTML` -- 烟花

一: C语言 – 烟花

运行效果:
在这里插入图片描述
在这里插入图片描述

#include <graphics.h>
#include <math.h>
#include <time.h>
#include <stdio.h>

#define MAXNUM 15
#define WIDTH 640
#define HEIGHT 480
#define PI 3.1415926

struct Fire
{
	int nowx;
	int nowy;
	int endy;
	int radio;
	int explode;
	int rgb[3];
	COLORREF color;
}fire[MAXNUM];

void Init()
{
	for (int i = 0; i < MAXNUM; i++)
	{
		fire[i].nowx = rand() % WIDTH;
		fire[i].nowy = HEIGHT + rand() % 250 + 50;
		fire[i].endy = rand() % 100 + 10;
		fire[i].radio = rand() % 50 + 120;
		fire[i].explode = 0;
		int c[][3] = { {255, 0, 0}, {210, 190, 255}, {255, 120, 0}, {255, 0, 150}, {255, 240, 100}, {10, 255, 255}, {160, 10, 255}, {255, 200, 60} };
		int n = rand() % 8;
		fire[i].color = RGB(c[n][0], c[n][1], c[n][2]);
		fire[i].rgb[0] = c[n][0];
		fire[i].rgb[1] = c[n][1];
		fire[i].rgb[2] = c[n][2];
	}
}

void Draw()
{
	for (int i = 0; i < MAXNUM; i++)
	{
		if (fire[i].nowy > fire[i].endy)
		{
			for (int size = 5; size > 0; size--)
			{
				int temp[] = { fire[i].rgb[0], fire[i].rgb[1], fire[i].rgb[2] };
				for (int k = 0; k < 3; k++)
				{
					temp[k] += 50 * (5 - size);
					if (temp[k] > 255) temp[k] = 255;
				}
				setfillcolor(RGB(temp[0], temp[1], temp[2]));
				solidcircle(fire[i].nowx, fire[i].nowy + 15 * (10 - size), size);
			}
		}
		else
		{
			for (int a = 0; a < 360; a += 30)
			{
				for (int size = 5; size > 0; size--)
				{
					int x = cos(a * PI / 180.0) * (fire[i].explode + size * 10) + fire[i].nowx;
					int y = sin(a * PI / 180.0) * (fire[i].explode + size * 10) + fire[i].nowy + fire[i].radio / 2;
					int temp[] = { fire[i].rgb[0], fire[i].rgb[1], fire[i].rgb[2] };
					for (int k = 0; k < 3; k++)
					{
						temp[k] += 50 * (5 - size);
						if (temp[k] > 255) temp[k] = 255;
					}
					setfillcolor(RGB(temp[0], temp[1], temp[2]));
					solidcircle(x, y + (HEIGHT - y) * 0.1 + size * (size - 2), size);
				}
			}
		}
	}
}

void Move()
{
	for (int i = 0; i < MAXNUM; i++)
	{
		if (fire[i].nowy > fire[i].endy)
		{
			fire[i].nowy -= 3;
		}
		else
		{
			if (fire[i].explode >= fire[i].radio)
			{
				fire[i].nowx = rand() % WIDTH;
				fire[i].nowy = HEIGHT + rand() % 250 + 50;
				fire[i].endy = rand() % 100 + 10;
				fire[i].radio = rand() % 50 + 120;
				fire[i].explode = 0;
				int c[][3] = { {255, 0, 0}, {210, 190, 255}, {255, 120, 0}, {255, 0, 150}, {255, 240, 100}, {10, 255, 255}, {160, 10, 255}, {255, 200, 60} };
				int n = rand() % 8;
				fire[i].color = RGB(c[n][0], c[n][1], c[n][2]);
				fire[i].rgb[0] = c[n][0];
				fire[i].rgb[1] = c[n][1];
				fire[i].rgb[2] = c[n][2];
			}
			else fire[i].explode++;
		}
	}
}

int main()
{
	srand(time(NULL));
	initgraph(640, 480);
	Init();
	BeginBatchDraw();
	while (true)
	{
		cleardevice();
		Draw();
		Move();
		FlushBatchDraw();
		Sleep(2);
	}
	EndBatchDraw();
	closegraph();
	return 0;
}

二:Python – 春联

运行效果:
在这里插入图片描述

from distutils.core import setup
from turtle import *
bgcolor("#FFFF00")
pensize(5)
setup(1000, 1000)
update()
fillcolor("red")
pencolor("firebrick2")

pu()
goto(-330, 250)
seth(0)
pd()

begin_fill()
for i in range(2):
    fd(360)
    left(90)
    fd(100)
    left(90)
end_fill()

pencolor("black")
pu()

texts = ["常", "乐", "安", "宁"]
for text in texts:
    fd(72)
    write(text, align="center", font=("华文行楷", 60, "normal"))

pencolor("firebrick2")

goto(-380, 200)
seth(180)
pd()

begin_fill()
for i in range(2):
    fd(100)
    left(90)
    fd(560)
    left(90)
end_fill()

pu()
goto(-430, 200)
pencolor("black")
seth(-90)

texts = "常怀欣喜心常乐"
for text in texts:
    fd(80)
    write(text, align="center", font=("华文行楷", 60, "normal"))

pencolor("firebrick2")
goto(180, 200)
seth(180)
pd()

begin_fill()
for i in range(2):
    fd(100)
    left(90)
    fd(560)
    left(90)
end_fill()

pu()
goto(130, 200)
pencolor("black")
seth(-90)

texts = "欣悦四季心安宁"
for text in texts:
    fd(80)
    write(text, align="center", font=("华文行楷", 60, "normal"))
ht()
done()

三:Python – 烟花

运行效果:
在这里插入图片描述
在这里插入图片描述

import pygame
from random import randint
from random import uniform
from random import choice
import  math
vector = pygame.math.Vector2
# 重力变量
gravity = vector(0, 0.3)
# 控制窗口的大小
DISPLAY_WIDTH = DISPLAY_HEIGHT = 800

# 颜色选项
trail_colours = [(45, 45, 45), (60, 60, 60), (75, 75, 75), (125, 125, 125), (150, 150, 150)]
dynamic_offset = 1
static_offset = 3
class Firework:
    def __init__(self):
        # 随机颜色
        self.colour = (randint(0, 255), randint(0, 255), randint(0, 255))
        self.colours = (
            (randint(0, 255), randint(0, 255), randint(0, 255)),
            (randint(0, 255), randint(0, 255), randint(0, 255)),
            (randint(0, 255), randint(0, 255), randint(0, 255)))
        self.firework = Particle(randint(0, DISPLAY_WIDTH), DISPLAY_HEIGHT, True,
                                 self.colour)  
        self.exploded = False
        self.particles = []
        self.min_max_particles = vector(100, 225)

    def update(self, win):  # 每帧调用
        if not self.exploded:
            self.firework.apply_force(gravity)
            self.firework.move()
            for tf in self.firework.trails:
                tf.show(win)

            self.show(win)

            if self.firework.vel.y >= 0:
                self.exploded = True
                self.explode()
        else:
            for particle in self.particles:
                particle.apply_force(vector(gravity.x + uniform(-1, 1) / 20, gravity.y / 2 + (randint(1, 8) / 100)))
                particle.move()
                for t in particle.trails:
                    t.show(win)
                particle.show(win)

    def explode(self):
        # amount 数量
        amount = randint(self.min_max_particles.x, self.min_max_particles.y)
        for i in range(amount):
            self.particles.append(Particle(self.firework.pos.x, self.firework.pos.y, False, self.colours))

    def show(self, win):
        pygame.draw.circle(win, self.colour, (int(self.firework.pos.x), int(self.firework.pos.y)), self.firework.size)

    def remove(self):
        if self.exploded:
            for p in self.particles:
                if p.remove is True:
                    self.particles.remove(p)

            if len(self.particles) == 0:
                return True
            else:
                return False

class Particle:
    def __init__(self, x, y, firework, colour):
        self.firework = firework
        self.pos = vector(x, y)
        self.origin = vector(x, y)
        self.radius = 20
        self.remove = False
        self.explosion_radius = randint(5, 18)
        self.life = 0
        self.acc = vector(0, 0)
        self.trails = []  
        self.prev_posx = [-10] * 10  
        self.prev_posy = [-10] * 10  

        if self.firework:
            self.vel = vector(0, -randint(17, 20))
            self.size = 5
            self.colour = colour
            for i in range(5):
                self.trails.append(Trail(i, self.size, True))
        else:
            self.vel = vector(uniform(-1, 1), uniform(-1, 1))
            self.vel.x *= randint(7, self.explosion_radius + 2)
            self.vel.y *= randint(7, self.explosion_radius + 2)
            # 向量
            self.size = randint(2, 4)
            self.colour = choice(colour)
            # 5 个 tails总计
            for i in range(5):
                self.trails.append(Trail(i, self.size, False))

    def apply_force(self, force):
        self.acc += force

    def move(self):
        if not self.firework:
            self.vel.x *= 0.8
            self.vel.y *= 0.8
        self.vel += self.acc
        self.pos += self.vel
        self.acc *= 0

        if self.life == 0 and not self.firework:  # 检查粒子的爆炸范围
            distance = math.sqrt((self.pos.x - self.origin.x) ** 2 + (self.pos.y - self.origin.y) ** 2)
            if distance > self.explosion_radius:
                self.remove = True

        self.decay()

        self.trail_update()

        self.life += 1

    def show(self, win):
        pygame.draw.circle(win, (self.colour[0], self.colour[1], self.colour[2], 0), (int(self.pos.x), int(self.pos.y)),
                           self.size)

    def decay(self):  # random decay of the particles
        if 50 > self.life > 10:  # early stage their is a small chance of decay
            ran = randint(0, 30)
            if ran == 0:
                self.remove = True
        elif self.life > 50:
            ran = randint(0, 5)
            if ran == 0:
                self.remove = True

    def trail_update(self):
        self.prev_posx.pop()
        self.prev_posx.insert(0, int(self.pos.x))
        self.prev_posy.pop()
        self.prev_posy.insert(0, int(self.pos.y))

        for n, t in enumerate(self.trails):
            if t.dynamic:
                t.get_pos(self.prev_posx[n + dynamic_offset], self.prev_posy[n + dynamic_offset])
            else:
                t.get_pos(self.prev_posx[n + static_offset], self.prev_posy[n + static_offset])
class Trail:
    def __init__(self, n, size, dynamic):
        self.pos_in_line = n
        self.pos = vector(-10, -10)
        self.dynamic = dynamic

        if self.dynamic:
            self.colour = trail_colours[n]
            self.size = int(size - n / 2)
        else:
            self.colour = (255, 255, 200)
            self.size = size - 2
            if self.size < 0:
                self.size = 0

    def get_pos(self, x, y):
        self.pos = vector(x, y)

    def show(self, win):
        pygame.draw.circle(win, self.colour, (int(self.pos.x), int(self.pos.y)), self.size)


def update(win, fireworks):
    for fw in fireworks:
        fw.update(win)
        if fw.remove():
            fireworks.remove(fw)

    pygame.display.update()

def main():
    pygame.init()
    pygame.font.init()
    pygame.display.set_caption("祝您新年快乐")  # 标题
    background = pygame.image.load("./5.png")  # 背景
    sound_wav = pygame.mixer.music.load("2.mp3")
    pygame.mixer.music.play()


pygame.init()
# 加载背景音乐
'''pygame.mixer.music.load("./res/音乐文件名")
# 循环播放背景音乐
pygame.mixer.music.play(-1)
# 停止背景音乐
pygame.mixer.music.stop()
# 加载音效
boom_sound = pygame.mixer.Sound("./res/音效名")
# 播放音效
boom_sound.play()
boom_sound.stop()
myfont = pygame.font.Font("simkai.TTF", 80)
myfont1 = pygame.font.Font("simkai.ttf", 30)
testsurface = myfont.render("虎虎生威", False, (0, 0, 0), (220, 20, 60))
testsurface1 = myfont1.render("", False, (251, 59, 85))'''

win = pygame.display.set_mode((DISPLAY_WIDTH, DISPLAY_HEIGHT))
clock = pygame.time.Clock()

fireworks = [Firework() for i in range(2)]  
running = True

while running:
    clock.tick(60)
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            running = False
        if event.type == pygame.KEYDOWN:
            if event.key == pygame.K_1:  # 按下 1
                fireworks.append(Firework())
            if event.key == pygame.K_2:  # 按下 2 加入10个烟花
                for i in range(10):
                    fireworks.append(Firework())
            if event.key == pygame.K_3:  # 按下 3 加入100个烟花
                for i in range(100):
                    fireworks.append(Firework())
    win.fill((20, 20, 30))  

    if randint(0, 20) == 1:  # 创建新的烟花

        fireworks.append(Firework())

    update(win, fireworks)
pygame.quit()
quit()

if __name__ == 'main':
    main()

四:HTML – 烟花

运行效果:
在这里插入图片描述
在这里插入图片描述

<!DOCTYPE html>
<html dir="ltr" lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" />
<title>夜空烟花</title>
	<script type="text/javascript" src="http://g.huceo.com/weixin/qw/jquery.min.js"></script>
      <script type="text/javascript">

      </script>
<style>
body {
	background: #000;
	margin: 0;
}

canvas {
	cursor: crosshair;
	display: block;
}
.STYLE1 {color: #333333}
</style>
</head>
<div style="text-align:center;clear:both">

</div>
<canvas id="canvas"><span class="STYLE1">Open IE effect more perfect </span></canvas>
<script>
window.requestAnimFrame = ( function() {
	return window.requestAnimationFrame ||
				window.webkitRequestAnimationFrame ||
				window.mozRequestAnimationFrame ||
				function( callback ) {
					window.setTimeout( callback, 1000 / 60 );
				};
})();

var canvas = document.getElementById( 'canvas' ),
		ctx = canvas.getContext( '2d' ),
		cw = window.innerWidth,
		ch = window.innerHeight,
		fireworks = [],
		particles = [],
		hue = 120,
		limiterTotal = 5,
		limiterTick = 0,
		timerTotal = 80,
		timerTick = 0,
		mousedown = false,
		mx,
		my;
		
canvas.width = cw;
canvas.height = ch;

function random( min, max ) {
	return Math.random() * ( max - min ) + min;
}

function calculateDistance( p1x, p1y, p2x, p2y ) {
	var xDistance = p1x - p2x,
			yDistance = p1y - p2y;
	return Math.sqrt( Math.pow( xDistance, 2 ) + Math.pow( yDistance, 2 ) );
}

function Firework( sx, sy, tx, ty ) {
	this.x = sx;
	this.y = sy;
	this.sx = sx;
	this.sy = sy;
	this.tx = tx;
	this.ty = ty;
	this.distanceToTarget = calculateDistance( sx, sy, tx, ty );
	this.distanceTraveled = 0;
	this.coordinates = [];
	this.coordinateCount = 3;
	while( this.coordinateCount-- ) {
		this.coordinates.push( [ this.x, this.y ] );
	}
	this.angle = Math.atan2( ty - sy, tx - sx );
	this.speed = 2;
	this.acceleration = 1.05;
	this.brightness = random( 50, 70 );
	this.targetRadius = 1;
}

Firework.prototype.update = function( index ) {
	this.coordinates.pop();
	this.coordinates.unshift( [ this.x, this.y ] );
    if( this.targetRadius < 8 ) {
		this.targetRadius += 0.3;
	} else {
		this.targetRadius = 1;
	}
	
	this.speed *= this.acceleration;
    var vx = Math.cos( this.angle ) * this.speed,
			vy = Math.sin( this.angle ) * this.speed;
	this.distanceTraveled = calculateDistance( this.sx, this.sy, this.x + vx, this.y + vy );
	
	if( this.distanceTraveled >= this.distanceToTarget ) {
		createParticles( this.tx, this.ty );
		fireworks.splice( index, 1 );
	} else {
		this.x += vx;
		this.y += vy;
	}
}

Firework.prototype.draw = function() {
	ctx.beginPath();
	ctx.moveTo( this.coordinates[ this.coordinates.length - 1][ 0 ], this.coordinates[ this.coordinates.length - 1][ 1 ] );
	ctx.lineTo( this.x, this.y );
	ctx.strokeStyle = 'hsl(' + hue + ', 100%, ' + this.brightness + '%)';
	ctx.stroke();
	
	ctx.beginPath();
	ctx.arc( this.tx, this.ty, this.targetRadius, 0, Math.PI * 2 );
	ctx.stroke();
}

function Particle( x, y ) {
	this.x = x;
	this.y = y;
	this.coordinates = [];
	this.coordinateCount = 5;
	while( this.coordinateCount-- ) {
		this.coordinates.push( [ this.x, this.y ] );
	}
	this.angle = random( 0, Math.PI * 2 );
	this.speed = random( 1, 10 );
	this.friction = 0.95;
	this.gravity = 1;
	this.hue = random( hue - 20, hue + 20 );
	this.brightness = random( 50, 80 );
	this.alpha = 1;
	this.decay = random( 0.015, 0.03 );
}

Particle.prototype.update = function( index ) {
	this.coordinates.pop();
	this.coordinates.unshift( [ this.x, this.y ] );
	this.speed *= this.friction;
	this.x += Math.cos( this.angle ) * this.speed;
	this.y += Math.sin( this.angle ) * this.speed + this.gravity;
	this.alpha -= this.decay;
    if( this.alpha <= this.decay ) {
		particles.splice( index, 1 );
	}
}

Particle.prototype.draw = function() {
	ctx. beginPath();
	ctx.moveTo( this.coordinates[ this.coordinates.length - 1 ][ 0 ], this.coordinates[ this.coordinates.length - 1 ][ 1 ] );
	ctx.lineTo( this.x, this.y );
	ctx.strokeStyle = 'hsla(' + this.hue + ', 100%, ' + this.brightness + '%, ' + this.alpha + ')';
	ctx.stroke();
}

function createParticles( x, y ) {
	var particleCount = 30;
	while( particleCount-- ) {
		particles.push( new Particle( x, y ) );
	}
}

function loop() {
	requestAnimFrame( loop );
	
	hue += 0.5;

	ctx.globalCompositeOperation = 'destination-out';
	ctx.fillStyle = 'rgba(0, 0, 0, 0.5)';
	ctx.fillRect( 0, 0, cw, ch );
	ctx.globalCompositeOperation = 'lighter';
	
	var i = fireworks.length;
	while( i-- ) {
		fireworks[ i ].draw();
		fireworks[ i ].update( i );
	}
	
	var i = particles.length;
	while( i-- ) {
		particles[ i ].draw();
		particles[ i ].update( i );
	}
	
	if( timerTick >= timerTotal ) {
		if( !mousedown ) {
			fireworks.push( new Firework( cw / 2, ch, random( 0, cw ), random( 0, ch / 2 ) ) );
			timerTick = 0;
		}
	} else {
		timerTick++;
	}
    if( limiterTick >= limiterTotal ) {
		if( mousedown ) {
			fireworks.push( new Firework( cw / 2, ch, mx, my ) );
			limiterTick = 0;
		}
	} else {
		limiterTick++;
	}
}

canvas.addEventListener( 'mousemove', function( e ) {
	mx = e.pageX - canvas.offsetLeft;
	my = e.pageY - canvas.offsetTop;
});

canvas.addEventListener( 'mousedown', function( e ) {
	e.preventDefault();
	mousedown = true;
});

canvas.addEventListener( 'mouseup', function( e ) {
	e.preventDefault();
	mousedown = false;
});

window.onload = loop;
</script>

上述代码复制后即可使用,无素材
轻舟在这里祝大家新年快乐,龙年迎好运!!!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1443135.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

BUUCTF LKWA

1.访问页面。 2.选择 Variables variable 关卡 3.获得flag http://357dab81-78b8-4d74-976a-4a69dd894542.node5.buuoj.cn:81/variables/variable.php?funcpassthru&inputcat%2Fflagflag{0020ced6-8166-4fa5-87a7-7d93ee687c3e}

跟着pink老师前端入门教程-day23

苏宁网首页案例制作 设置视口标签以及引入初始化样式 <meta name"viewport" content"widthdevice-width, user-scalableno, initial-scale1.0, maximum-scale1.0, minimum-scale1.0"> <link rel"stylesheet" href"css/normaliz…

Days 26 ElfBoard RGB接口

1. RGB接口介绍 ELF 1支持并行24位LCD,最大RGB888 24位&#xff0c;最高分辨率支持WXGA&#xff08;1366x768&#xff09;&#xff0c;刷新频率为60Hz&#xff0c;底板采用的是RGB565的连接方式&#xff0c;通过一个0.5mm间距54P的FPC座&#xff08;P9&#xff09;引出&#x…

用python写个类

对类的简单概述 面向过程编程,是按照预定的顺序一步步执行,面向对象编程则是将相似的对象归为一类,定义它们的属性和行为,例如人有姓名,性别,年龄等属性,有吃饭,睡觉,学习等行为.这便是类,类是对象的模版,对象是类的实例,例如人是一个抽象的类,而张三是一个具体的对象. 学会用…

Spring Boot3统一结果封装

⛰️个人主页: 蒾酒 &#x1f525;系列专栏&#xff1a;《spring boot实战》 &#x1f30a;山高路远&#xff0c;行路漫漫&#xff0c;终有归途。 目录 前置条件 封装目的 常用格式 定义返回结果枚举类 定义返回结果封装类 对返回结果封装 测试封装 前置条件 已…

黄金交易策略(Nerve Knife):反趋势锁定单的处理机制

锁定单是由大趋势反转之后原来的趋势单转变而来的&#xff0c;会在趋势再次反转时变为趋势单或者转入保留单&#xff0c;也有很大概率在趋势识别到转变之前就被减仓减掉了。 完整EA&#xff1a;Nerve Knife.ex4黄金交易策略_黄金趋势ea-CSDN博客 一、锁定单怎么样来的&#xf…

旅游|基于Springboot的旅游管理系统设计与实现(源码+数据库+文档)

旅游管理系统目录 目录 基于Springboot的旅游管理系统设计与实现 一、前言 二、系统功能设计 三、系统实现 1、用户管理 2、景点分类管理 3、景点信息管理 4、酒店信息管理 5、景点信息 6、游记分享管理 四、数据库设计 1、实体ER图 2、具体的表设计如下所示&#xf…

MySQL-视图(VIEW)

文章目录 1. 什么是视图&#xff1f;2. 视图 VS 数据表3. 视图的优点4. 视图相关语法4.1 创建视图4.2 查看视图4.3 修改视图4.4 删除视图4.5 检查选项 5. 案例6. 注意事项 1. 什么是视图&#xff1f; MySQL 视图&#xff08; View&#xff09;是一种虚拟存在的表&#xff0c;同…

Python实现计数排序

对于如果存在使用两个数组成员进行比较的操作&#xff0c;该方法会导致排序算法的时间复杂度会存在一个下界问题&#xff0c;该问题在使用计数排序的时候可以突破这个理论下界&#xff0c;也即是不适用元素比对的操作的算法之一&#xff0c;计数排序。 添加图片注释&#xff0c…

关于数字图像处理考试

我们学校这门科目是半学期就完结哦&#xff0c;同学们学习的时候要注意时间哦。 选择题不用管&#xff0c;到时候会有各种版本的复习资料的。 以下这些东西可能会是大题的重点&#xff1a; 我根据平时代码总结的&#xff0c;供参考 基本操作&#xff1a; 1.读图&#xff1a;…

【数据结构与算法】【腾讯阿里链表面试题】算法题--链表易懂版讲解

&#x1f389;&#x1f389;欢迎光临&#x1f389;&#x1f389; &#x1f3c5;我是苏泽&#xff0c;一位对技术充满热情的探索者和分享者。&#x1f680;&#x1f680; &#x1f31f;特别推荐给大家我的最新专栏《Spring 狂野之旅&#xff1a;底层原理高级进阶》 &#x1f680…

【正式】今年第一篇CSDN(纯技术教学)

一、文件上传简介 文件上传漏洞是指用户上传了一个可执行的脚本文件&#xff08;木马、病毒、恶意脚本、webshell等&#xff09;&#xff0c;并通过此脚本文件获得了执行服务器端命令的能力。上传点一般出现在头像、导入数据、上传压缩包等地方&#xff0c;由于程序对用户上传…

CSP-202009-1-称检测点查询

CSP-202009-1-称检测点查询 解题思路 本题的时间复杂度貌似没有限制&#xff0c;直接暴力枚举就能知识盲点&#xff1a;sort()函数-升序排序 #include <algorithm>给名为dis&#xff0c;长度为n的数组排序sort(new_dis, new_dis n); #include <iostream> #inc…

三、OpenAI所有模型介绍

1. 综述 OpenAI API开发了具有各种能力的模型。可以根据不同的需求选择不同的模型并进行精调。 模型描述GPT-4、GPT-4 Turbo一组从GPT-3.5升级后的模型&#xff0c;能够生成自然语言和代码GPT-3.5 Turbo一组从GPT-3.5升级后的模型&#xff0c;能够生成自然语言和代码DALL.E能…

搭建yum仓库服务器

安装 1.安装linux 1.1安装依赖 yum -y install gcc zlib zlib-devel pcre-devel openssl openssl-devel 1.2下载 cd /opt/nginx wget http://nginx.org/download/nginx-1.25.3.tar.gz 1.3解压 tar -xvf nginx-1.25.3.tar.gz 1.4配置 cd nginx-1.25.3 ./configure --pre…

python高校实验室管理系统的django设计与实现81txp

技术栈 后端&#xff1a;python 前端&#xff1a;vue.jselementui 框架&#xff1a;django Python版本&#xff1a;python3.7 数据库&#xff1a;mysql5.7 数据库工具&#xff1a;Navicat 开发软件&#xff1a;PyCharm .本高校实验室管理系统采用python语言、MySQL数据库&…

python 爬虫篇(3)---->Beautiful Soup 网页解析库的使用(包含实例代码)

Beautiful Soup 网页解析库的使用 文章目录 Beautiful Soup 网页解析库的使用前言一、安装Beautiful Soup 和 lxml二、Beautiful Soup基本使用方法标签选择器1 .string --获取文本内容2 .name --获取标签本身名称3 .attrs[] --通过属性拿属性的值标准选择器find_all( name , at…

ad18学习笔记十八:如何放置丝印层敷铜?

我画板的时候&#xff0c;需要把板卡顶面丝印层的一个矩形区域&#xff0c;画成白色&#xff0c;但是这个区域内有好几个焊盘&#xff0c;丝印涂色的地方需要避开这几个焊盘&#xff0c;我觉得不能简单的在丝印层画一个矩形完事&#xff0c;最好让丝印层的这个区域&#xff0c;…

会声会影绿幕抠图操作方法 会声会影绿幕抠图有绿色残边 绿幕抠图视频有绿边怎么处理 抖音怎么剪辑视频 视频剪辑软件推荐

科幻片里真的存在怪兽吗&#xff1f;外太空的画面是直接将演员放入太空拍摄的吗?其实这些不切实际的画面是通过绿幕拍摄实现的。你只需要在绿幕前拍一段太空漫步的视频&#xff0c;再利用会声会影的抠图功能就能实现&#xff01;如果你还不会绿幕抠图&#xff0c;我今天就手把…

【从Python基础到深度学习】6. IPython使用PyCharm代码调试与使用PEP

一、IPython交互式shell Python的解释器如今有多个语言的实现&#xff0c;包括: CPython ——官方版本的c语言实现 ython ——可以运行在Java平台 IronPython ——可以运行在.NET和Mono平台PyPy —— Python实现的&#xff0c;支持JIT即时编译 1.PyCharm中 2.Ubuntu终端中 s…