这下面是源码,资源是easyx
下载地址直接百度搜索就有了easyx
要可以直接运行的直接评论。
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
#include<string.h>
#include<easyx.h>
//多媒体设备头文件
#include<mmsystem.h>
#pragma comment(lib,"winmm.lib")
#define RAIN_NUM 128
#define STR_NUM 20
#define screenw 640
#define screenh 960
#define ball_num 5
struct Rain
{
int x;
int y;
int speed;//速度
char str[STR_NUM+1];
}rain[RAIN_NUM];
struct Ball
{
int ballx;
int bally;
int ballr;
int movex;
int movey;
}ball[ball_num];
//随机生成一个字符 大写 小写 数字
char cearteChr()
{
switch (rand() % 3)//随机产生一个整数,如果没有设置随机数种子,那么就是一个固定的数
{
case 0: