好的,这是一个使用 Java 编写的特效元旦代码:
public class NewYearEffect {
public static void main(String[] args) {
// 打印元旦贺词
System.out.println("新年快乐!");
// 打印烟花特效
for (int i = 0; i < 10; i++) {
int x = (int)(Math.random() * 80); // 烟花的 x 坐标
int y = (int)(Math.random() * 25);