转载自:https://blog.csdn.net/ojzha/article/details/75182329
#include<stdlib.h> #include<stdio.h> #include<iostream> #include<time.h> //suiji #include <afx.h> #include<cstring> #include<windows.h> //SLEEP函数 struct Player //玩家结构体,并初始化player { char name[21]; int attack; int defense; int health; long int max_health; int level; int exp; int range_exp; long int max_exp; }player = { "勇者",50,40,100,100,1,0,0,100 }; struct Enemy //怪的结构体,并初始化各种怪 { char name[20]; char wupin[12]; int attack; int defense; int health; int money; long int exp; int wupin_sign; int wupinpro; int double_attack; int miss; }strongman = { "森林巨人","黄金圣衣",40,50,350,200,100,1,2,1,0 }, witch = { "森林女巫","银甲",25,15,100,50,50,2,2,1,1 }, xiyi = { "森林蜥蜴","铁甲",18,10,50,30,35,3,3,2,2 }, big_strongman = { "森林巨人王","巨人之臂",40 * 5,50 * 5,350 * 5,200 * 5,100 * 5,4,4,2,0 }, lion = { "草原雄狮","绝世好剑",60,30,280,200,100,5,2,1,0 }, horse = { "草原野马","碧血剑",28,12,90,50,50,6,2,1,1 }, bee = { "草原黄蜂","长剑",17,11,60,30,35,7,3,2,2 }, shitu = { "使徒","