C++控制台代码实现一定的界面效果Ⅲ

该博客介绍了C++实现的控制台购物程序,包括页面功能完善、函数执行次数统计和页面导航。程序使用了类`FunctionList`来管理列表,支持上、下移动选项,页面切换等功能。此外,还展示了如何添加和修改数据,如皮肤数据的存储和读取。程序中包含了购买商品、查询订单和系统管理等模块。
摘要由CSDN通过智能技术生成

以下为主要的头文件代码,只需要在头文件中添加即可。

使用此头文件开发的实例可以参考: C++控制台模拟购物程序.

此头文件的更老版本可以参考: ICUF_HEAD_04.h.

此头文件的更新版本可以参考: ICUF_HEAD_06.h.

开发环境:Visual Studio 2019


ICUF_HEAD_05.h

此头文件在ICUF_HEAD_04.h的基础上将页面的功能进行了完善,同时对之前的函数进行了部分修改,以支持页面效果的实现。添加了一个功能用于计算某功能在某个类成员中的执行次数,可以使指定代码仅执行一次。

//ICUF_HEAD_05.H

#ifndef ICUF_HEAD_05
#define ICUF_HEAD_05
#include<iostream>
#include<string>
#include<fstream>
#include<conio.h>
using namespace std;
inline void Col(int ColN)//设置自定义行的背景颜色
{
	if (ColN == 0)cout << "\033[0m";//清除颜色
	else
	{
		cout << "\033[04m\033[1m\033[7m";
		if (ColN == 1)cout << "\033[31m";//红色
		else if (ColN == 2)cout << "\033[32m";//绿色
		else if (ColN == 3)cout << "\033[33m";//黄色
		else if (ColN == 4)cout << "\033[34m";//蓝色
		else if (ColN == 5)cout << "\033[35m";//紫色
		else if (ColN == 6)cout << "\033[36m";//淡蓝
		else if (ColN == 7)cout << "\033[37m";//白色
		else if (ColN == 8)Col((rand() % 6) + 1);//随机颜色(1-7)
	}
}
class FunctionList
{
public:int Page{ 1 };
public:int Times{};//用于计算某一函数的执行次数,同时用于限定某些代码只执行一次
public:int TempTimes{};
public:int FunctionNumbers = 0;//表示类中含有的字符串数量
public:void RecoverTimes()
{
	this->Times += this->TempTimes;
	this->TempTimes = 0;
}
public:void RestTimes()
{
	this->TempTimes += this->Times;
	this->Times = 0;
}
public:void InitList(int Start = 0)//列表初始化函数,默认初始化第一个选项为选定状态
{
	for (int i = 0; i < FunctionNumbers; i++)
	{
		ListStatus[i] = 0;
	}
	for (int i = FunctionNumbers; i < 50; i++)
	{
		ListStatus[i] = -1;
	}
	ListStatus[Start] = 1;
}
public:void DisplayList()//显示列表
{
	int Start, End;
	Start = (Page - 1) * LimitListEachPage;
	End = Start + LimitListEachPage;
	cout << "FunId: " << CheckCurrent() << "  Limit: " << LimitListEachPage << "  Page: " << Page << "  Start: " << Start << "  End: " << End << endl << endl;
	for (int i = Start; i < End; i++)
	{
		if (ListStatus[i] != -1)
		{
			if (ListStatus[i] == 1)
				Col(7);
			else
				Col(1);
			cout << "               " << List[i] << "               " << endl << endl;
			Col(0);
		}
	}
}
public:int InsertAction()//输入控制
{
	char Key;
	int Temp;
	Key = _getch();
	if (Key == 'c' || Key == 'C')
		return 3;
	if (FunctionNumbers == 0)
		return 0;
	if ((int)(Key - 48) > 0 && (int)(Key - 48) <= 9)//判断是否是从零到九的数字
	{
		if ((int)(Key - 48) > FunctionNumbers)//如果是,且小于等于选项总数则直接指定这个选项
			InitList(FunctionNumbers - 1);
		else
			InitList((int)(Key - 48) - 1);//如果超出了最大值,则指向最大值
		return 4;
	}
	else if (Key == 'w' || Key == 'W' || Key == 72)//如果输入了大小写的W或者上箭头,则执行MoveUp函数
	{
		MoveUp();
		return 0;
	}
	else if (Key == 's' || Key == 'S' || Key == 80)//如果输入了大小写的S或者下箭头,则执行MoveDown函数
	{
		MoveDown();
		return 0;
	}
	else if (Key == 'z' || Key == 'Z')//对页面切换功能的第二次改进,此版本不需要在主页面对第一个返回值进行判断
	{
		if (Page != 1)
		{
			Page--;
			Temp = CheckCurrent();
			ListStatus[Temp] = 0;
			ListStatus[Temp - LimitListEachPage] = 1;
		}
		else
		{
			Page = GetPages();
			Temp = CheckCurrent();
			ListStatus[Temp] = 0;
			ListStatus[(Page - 1) * LimitListEachPage] = 1;
		}
		return 1;
	}
	else if (Key == 'x' || Key == 'X')
	{
		if (Page != GetPages())
		{
			Page++;
			Temp = CheckCurrent();
			ListStatus[Temp] = 0;
			if (Temp + LimitListEachPage >= FunctionNumbers - 1)
				ListStatus[FunctionNumbers - 1] = 1;
			else
				ListStatus[Temp + LimitListEachPage] = 1;
		}
		else
		{
			Page = 1;
			Temp = CheckCurrent();
			ListStatus[Temp] = 0;
			ListStatus[Temp % LimitListEachPage] = 1;
		}
		return 2;
	}
	else if (Key == '\r')
		return 4;
	return 0;
}
public:void MoveUp()//选项上移
{
	int i = CheckCurrent();//找到当前指向的选项
	if (i == 0 && FunctionNumbers == 1)//如果只有一个选项则不变
		ListStatus[i] = 1;
	else if (i == 0 && FunctionNumbers != 1)//如果指向第一个且不止包含一个选项,则改为指向最下方的选项
	{
		ListStatus[i] = 0;
		Page = GetPages();
		ListStatus[FunctionNumbers - 1] = 1;
	}
	else if ((i + 1) % LimitListEachPage == 1)//如果指向某一页面的第一项则翻页,并指向前一页的最后一项
	{
		if (Page != 1)
		{
			Page--;
			ListStatus[i] = 0;
			ListStatus[i - 1] = 1;
		}
		else
		{
			Page = GetPages();
			ListStatus[i] = 0;
			ListStatus[FunctionNumbers - 1] = 1;
		}
	}
	else//正常情况
	{
		ListStatus[i] = 0;
		ListStatus[i - 1] = 1;
	}
}
public:void MoveDown()//选项下移
{
	int i = CheckCurrent();//找到当前指向的选项
	if (i == 0 && FunctionNumbers == 1)//如果只有一个选项则不变
		ListStatus[i] = 1;
	else if (i != 0 && i == FunctionNumbers - 1)//如果指向最后一个且不止包含一个选项,则改为指向最上方的选项
	{
		ListStatus[FunctionNumbers - 1] = 0;
		Page = 1;
		ListStatus[0] = 1;
	}
	else if ((i + 1) % LimitListEachPage == 0)//如果指向某一页面的最后一项则翻页,并指向下一页的第一项
	{
		if (Page != GetPages())
		{
			Page++;
			ListStatus[i] = 0;
			ListStatus[i + 1] = 1;
		}
		else
		{
			Page = 1;
			ListStatus[i] = 0;
			ListStatus[0] = 1;
		}
	}
	else//正常情况
	{
		ListStatus[i] = 0;
		ListStatus[i + 1] = 1;
	}
}
public:int CheckCurrent()//找到当前指向的选项
{
	for (int j = 0; j < FunctionNumbers; j++)
	{
		if (ListStatus[j] == 1)
			return j;
	}
}
public:void Append(string FunctionName, int Times = 1)//List数组添加String成员
{
	if (Times != 0)
		return;
	List[FunctionNumbers] = FunctionName;
	FunctionNumbers += 1;//成员计数器
}
public:void SetMaxList(int List)
{
	LimitListEachPage = List;
}
public:void RemoveAll()//移除所有成员(在04.h版本中为重要功能,05.h中被Times计数器取代)
{
	for (int i = 0; i < 10; i++)
	{
		List[i] = {};
		FunctionNumbers = 0;
	}
}
public:int GetPages()
{
	if (FunctionNumbers % LimitListEachPage != 0)
		Pages = FunctionNumbers / LimitListEachPage + 1;
	else
		Pages = FunctionNumbers / LimitListEachPage;
	return Pages;
}
private:int Pages{ 1 };
private:int LimitListEachPage{ 9 };
private:string List[50]{};//存放选项名称
private:int ListStatus[50]{ -1 };//存放选项状态
};
#endif

此头文件我提供了一个完整的项目

ICUF2 0.00.01.57

// ICUF 2.0 - 0.00.01.57  2021/6/4 00:29
// 修复系统管理的选项指引错误的问题
// 修复增加数据会一直覆盖最后一个已存在数据的问题
// 系统管理功能将从类中迁移出来

#include <iostream>
#include <fstream>
#include <string>
#include "ICUF_HEAD_05.h";
using namespace std;
const char* SDL = "SkinData_Local.txt";
const char* Deals = "ICUF_Deal_Local.txt";
ofstream fout;
ifstream fin;
void BuyCargo(int Id = 0);
void BuyingCargo(int Id);
void ChangeData();
void SearchDeal();
void SearchDealShow();
void SearchDealById();
void ChangeData();
void Init();
FunctionList MainPage, BuyPage, BuyingPage, ChangeDPage, SearchDPage, SetPage;
struct ICUF_SkinData
{
    int ICUF_Id{ 0 };
    string ICUF_Name{};
    string ICUF_Float{};
    double ICUF_Price{};
};
ICUF_SkinData ISD[30];
class ICUF_Skin
{
public: FunctionList SetPage2, SetPage4;
public: void SetSkinData(int Mode)
{
    GetSkinData();
    if (Mode == 1)//从头开始修改数据(不会删除后面未经修改的数据)
    {
        int breakword{};
        system("cls");
        for (int i = BuyPage.FunctionNumbers; i < 30; i++)
        {
            Col(8); cout << "ICUF_Id  :" << i + 1 << endl; Col(0);
            ISD[i].ICUF_Id = i + 1;
            Col(8); cout << "请输入 ICUF_Name (string) :";
            cin >> ISD[i].ICUF_Name; Col(0);
            Col(8); cout << "请输入 ICUF_Float (string) :";
            cin >> ISD[i].ICUF_Float; Col(0);
            Col(8); cout << "请输入 ICUF_Price (double) :";
            cin >> ISD[i].ICUF_Price; Col(0);
            SetPage2.Append("1.继续", SetPage2.Times);
            SetPage2.Append("2.退出", SetPage2.Times++);
            SetPage2.InitList();
            while (1)
            {
                system("cls");
                for (int j = 0; j <= i; j++)
                {
                    Col(rand() % 6 + 1); cout << "ICUF_Id  :" << j + 1 << endl; Col(0);
                    ISD[j].ICUF_Id = j + 1;
                    Col(rand() % 6 + 1); cout << "ICUF_Name (string) :" << ISD[j].ICUF_Name << endl; Col(0);
                    Col(rand() % 6 + 1); cout << "ICUF_Float (string) :" << ISD[j].ICUF_Float << endl; Col(0);
                    Col(rand() % 6 + 1); cout << "ICUF_Price (double) :" << ISD[j].ICUF_Price << endl; Col(0);
                }
                SetPage2.DisplayList();
                int i = SetPage2.InsertAction();
                if (i == 3)
                {
                    ChangeData();
                }
                else if (i == 4)
                {
                    int i = SetPage2.CheckCurrent();
                    if (i == 0)
                    {
                        breakword = 0;
                        break;
                    }
                    else if (i == 1)
                    {
                        LengthOfData = i;
                        breakword = 1;
                        break;
                    }
                }
            }
            if (breakword == 1)
                break;
        }
        SaveSkinData();
    }
    else if (Mode == 2)//系统初始数据
    {
        RemoveData();
        for (int i = 0; i < 30; i++)
        {
            if (i == 0)
            {
                ISD[0].ICUF_Id = 1;
                ISD[0].ICUF_Name = "地下水";
                ISD[0].ICUF_Float = "久经沙场";
                ISD[0].ICUF_Price = 0.2;
            }
            else if (i == 1)
            {
                ISD[1].ICUF_Id = 2;
                ISD[1].ICUF_Name = "地下水";
                ISD[1].ICUF_Float = "略有磨损";
                ISD[1].ICUF_Price = 0.3;
            }
            else if (i == 2)
            {
                ISD[2].ICUF_Id = 3;
                ISD[2].ICUF_Name = "地下水";
                ISD[2].ICUF_Float = "崭新出厂";
                ISD[2].ICUF_Price = 0.4;
            }
            else if (i == 3)
            {
                ISD[3].ICUF_Id = 4;
                ISD[3].ICUF_Name = "狩猎网格";
                ISD[3].ICUF_Float = "久经沙场";
                ISD[3].ICUF_Price = 0.5;
            }
            else
            {
                ISD[i].ICUF_Id = NULL;
                ISD[i].ICUF_Name = "";
                ISD[i].ICUF_Float = "";
                ISD[i].ICUF_Price = NULL;
            }
        }
        SaveSkinData();
    }
    else if (Mode == 3)
    {
        RemoveData();
        for (int i = 0; i < 30; i++)
        {
            ISD[i].ICUF_Id = NULL;
            ISD[i].ICUF_Name = "";
            ISD[i].ICUF_Float = "";
            ISD[i].ICUF_Price = NULL;
        }
        SaveSkinData();
    }
    BuyPage.ResetTimes();
}
public: void SaveSkinData()
{
    fout.open(SDL);
    for (int i = 0; i < 30; i++)
    {
        if (ISD[i].ICUF_Id == 0)
        {
            LengthOfData = i;
            break;
        }
        fout << ISD[i].ICUF_Id << " " << ISD[i].ICUF_Name << " " << ISD[i].ICUF_Float << " " << ISD[i].ICUF_Price << endl;
    }
    fout.close();
}
public: void GetSkinData()
{
    fin.open(SDL);
    for (int i = 0; i < 30; i++)
    {
        fin >> ISD[i].ICUF_Id >> ISD[i].ICUF_Name >> ISD[i].ICUF_Float >> ISD[i].ICUF_Price;
    }
    fin.close();
}
public:int GetLength()
{
    return LengthOfData;
}
private: void RemoveData()
{
    remove(SDL);
    remove(Deals);
}
private:int LengthOfData{};
};
ICUF_Skin skin;
int main()
{
    Init();
    MainPage.Append("购买商品", MainPage.Times);
    MainPage.Append("查询订单", MainPage.Times);
    MainPage.Append("系统管理", MainPage.Times);
    MainPage.Append("退出系统", MainPage.Times++);
    MainPage.InitList();
    while (1)
    {
        system("cls");
        Col(1); cout << "\n\n\n\n                         欢迎来到ICUF购物平台  WiChG_Trade             \n\n"; Col(0);
        MainPage.DisplayList();
        int i = MainPage.InsertAction();
        if (i == 4)
        {
            int i = MainPage.CheckCurrent();
            if (i == 0)
                BuyCargo();
            else if (i == 1)
                SearchDeal();
            else if (i == 2)
                ChangeData();
            else if (i == 3)
                exit(1);
        }
    }
}
void BuyCargo(int Id)//购买商品主页面
{
    skin.GetSkinData();//读取本地文件数据
    skin.SaveSkinData();
    if (BuyPage.TempTimes != 0)
        BuyPage.RemoveAll();
    for (int i = 0; i < skin.GetLength(); i++)//使用头文件方法给列表添加物品
        BuyPage.Append(ISD[i].ICUF_Name + "  (" + ISD[i].ICUF_Float + ")", BuyPage.Times);
    BuyPage.Times++;
    BuyPage.RecoverTimes();
    BuyPage.InitList(Id);
    while (1)
    {
        system("cls");
        Col(1); cout << "\n\n\n\n                         欢迎来到ICUF购物平台  WiChG_Trade             \n\n"; Col(0);
        BuyPage.DisplayList();
        int i = BuyPage.InsertAction();
        if (i == 3)
            main();
        else if (i == 4)
        {
            int i = BuyPage.CheckCurrent();
            BuyingCargo(i);
        }
    }
}
void BuyingCargo(int Id)
{
    BuyingPage.Append("继续", BuyingPage.Times);
    BuyingPage.Append("返回", BuyingPage.Times++);
    BuyingPage.InitList();
    while (1)
    {
        system("cls");
        Col(8); cout << " ICUF_Id (int) :" << ISD[Id].ICUF_Id << endl; Col(0);
        Col(8); cout << " ICUF_Name (string) :" << ISD[Id].ICUF_Name << endl; Col(0);
        Col(8); cout << " ICUF_Float (string) :" << ISD[Id].ICUF_Float << endl; Col(0);
        Col(8); cout << " ICUF_Price (double) :" << ISD[Id].ICUF_Price << endl; Col(0);
        Col(8); cout << "是否继续购买?" << endl << endl; Col(0);
        BuyingPage.DisplayList();
        int i = BuyingPage.InsertAction();
        if (i == 3)
            BuyCargo(Id);
        else if (i == 4)
        {
            int i = BuyingPage.CheckCurrent();
            if (i == 1)
                BuyCargo();
            else
            {
                cout << "请输入购买商品的数量(" << ISD[Id].ICUF_Name << ") :";
                int Number;
                cin >> Number;
                int List = (rand() % 10) * 100000 + (rand() % 10) * 10000 + (rand() % 10) * 1000 + (rand() % 10) * 100 + (rand() % 10) * 10 + (rand() % 10);
                fout.close();
                fout.open(Deals, ios::app);
                fout << List << " " << Id << " " << ISD[Id].ICUF_Id << " " << Number << " " << ISD[Id].ICUF_Price * Number << endl;
                fout.close();
                cout << "购买成功  你的购买订单号为 " << List << endl;
                cout << "List ID : " << List << "  Cargo ID : " << Id << "  ICUF ID : " << ISD[Id].ICUF_Id << "  Number : " << Number << "  Price : " << ISD[Id].ICUF_Price * Number << endl;
                system("pause");
                BuyCargo();
            }
        }
    }   
}
void ChangeData()
{
    int LengthOfData{};
    ChangeDPage.Append("1.更改数据", ChangeDPage.Times);
    ChangeDPage.Append("2.添加数据", ChangeDPage.Times);
    ChangeDPage.Append("3.默认数据", ChangeDPage.Times);
    ChangeDPage.Append("4.清理数据", ChangeDPage.Times++);
    ChangeDPage.InitList();
    while (1)
    {
        system("cls");
        Col(1); cout << "\n\n\n\n                         ICUF购物平台-修改数据功能  WiChG_Trade             \n\n"; Col(0);
        ChangeDPage.DisplayList();
        int i = ChangeDPage.InsertAction();
        if (i == 3)
            main();
        else if (i == 4)
        {
            int i = ChangeDPage.CheckCurrent();
            if (i == 0)//更改单一数据功能
            {
                SetPage.RemoveAll();
                SetPage.ResetTimes();
                for (int i = 0; i < 30; i++)
                {
                    if (ISD[i].ICUF_Id == 0)
                    {
                        LengthOfData = i;
                        break;
                    }
                    cout << ISD[i].ICUF_Id << " " << ISD[i].ICUF_Name << " " << ISD[i].ICUF_Float << " " << ISD[i].ICUF_Price << endl;
                }
                int ISD_Id, ISD_Fun;
                Col(1); cout << "请输入要修改的物品的ICUF_Id :  ";
                cin >> ISD_Id; Col(0);
                SetPage.Append("1.ISD[i].ICUF_Id    (序号)", SetPage.Times);
                SetPage.Append("2.ISD[i].ICUF_Name  (名称)", SetPage.Times);
                SetPage.Append("3.ISD[i].ICUF_Float (磨损)", SetPage.Times);
                SetPage.Append("4.ISD[i].ICUF_Price (价格)", SetPage.Times++);
                SetPage.InitList();
                while (1)
                {
                    system("cls");
                    Col(1); cout << "\n\n\n\n                         更改单一数据  WiChG_Trade             \n\n"; Col(0);
                    SetPage.DisplayList();
                    int i = SetPage.InsertAction();
                    if (i == 3)
                    {
                        ChangeData();
                    }
                    else if (i == 4)
                    {
                        int i = SetPage.CheckCurrent();
                        ISD_Fun = i + 1;
                        break;
                    }
                }
                Col(1); cout << "请输入修改后的内容 :  ";
                switch (ISD_Fun)
                {
                case 1:
                    /*cin >> ISD[ISD_Id].ICUF_Id;*/
                    Col(1); cout << "暂时不提供修改序号的功能 !" << endl; Col(0);
                    break;
                case 2:
                    cin >> ISD[ISD_Id - 1].ICUF_Name;
                    break;
                case 3:
                    cin >> ISD[ISD_Id - 1].ICUF_Float;
                    break;
                case 4:
                    cin >> ISD[ISD_Id - 1].ICUF_Price;
                    break;
                }
                Col(0);
                skin.SaveSkinData();
            }
            else
            {
                SetPage.RecoverTimes();
                skin.SetSkinData(i);
            }
        }
    }
}
void SearchDeal()
{
    SearchDPage.Append("1.查询所有", SearchDPage.Times);
    SearchDPage.Append("2.按ID查询", SearchDPage.Times++);
    SearchDPage.InitList();
    while (1)
    {
        system("cls");
        Col(1); cout << "\n\n\n\n                         ICUF购物平台-查询订单功能  WiChG_Trade             \n\n"; Col(0);
        SearchDPage.DisplayList();
        int i = SearchDPage.InsertAction();
        if (i == 3)
            main();
        else if (i == 4)
        {
            int i = SearchDPage.CheckCurrent();
            switch (i)
            {
            case 0:
                SearchDealShow();
                break;
            case 1:
                SearchDealById();
                break;
            }
        }
    }
}
void SearchDealById()
{
    int list, List[30]{}, Number[30]{}, Id[30]{}, ICUF_Id[30]{}, DataLength{ 30 };
    double price[30]{};
    Col(8); cout << "请输入要查询的订单号 : ";
    cin >> list; Col(0);
    fin.open(Deals);
    for (int i = 0; i < 30; i++)
    {
        fin >> List[i] >> Id[i] >> ICUF_Id[i] >> Number[i] >> price[i];
        if (List[i] == 0)
        {
            DataLength = i;
            break;
        }
    }
    fin.close();
    fout.open(Deals);
    for (int i = 0; i < 30; i++)
    {
        if (List[i] == 0)
            break;
        fout << List[i] << " " << Id[i] << " " << ICUF_Id[i] << " " << Number[i] << " " << price[i] << endl;
        
    }
    fout.close();
    int flag{};
    Col(8);
    for (int j = 0; j < DataLength; j++)
    {
        if (List[j] == list)
        {
            cout << "List ID : " << List[j] << "  Cargo ID : " << Id[j] << "  ICUF ID : " << ICUF_Id[j] << "  Number : " << Number[j] << "  Price : " << price[j]; Col(0);
            flag = 1;
        }
        if (flag == 0 && j == DataLength - 1)
            cout << "不存在此订单!"; Col(0);
    }
    if (DataLength == 0)
        cout << "当前不存在任何已储存订单" << endl; Col(0);
    system("pause");
}
void SearchDealShow()//用于展示所有已储存的订单
{
    int List[30]{}, Number[30]{}, Id[30]{}, ICUF_Id[30]{}, DataLength{ 30 };
    double price[30]{};
    fin.open(Deals);
    for (int i = 0; i < 30; i++)
    {
        fin >> List[i] >> Id[i] >> ICUF_Id[i] >> Number[i] >> price[i];
        if (List[i] == 0)
        {
            DataLength = i;
            break;
        }
    }
    fin.close();
    fout.open(Deals);
    for (int i = 0; i < 30; i++)
    {
        if (List[i] == 0)
            break;
        fout << List[i] << " " << Id[i] << " " << ICUF_Id[i] << " " << Number[i] << " " << price[i] << endl;
        Col(8); cout << "List ID : " << List[i] << "  Cargo ID : " << Id[i] << "  ICUF ID : " << ICUF_Id[i] << "  Number : " << Number[i] << "  Price : " << price[i] << endl; Col(0);
    }
    fout.close();
    system("pause");
}
void Init()//用于判断执行次数并进行更新
{
    skin.GetSkinData();//读取本地文件数据
    skin.SaveSkinData();
    if (BuyPage.TempTimes != 0)
        BuyPage.RemoveAll();
    for (int i = 0; i < skin.GetLength(); i++)//使用头文件方法给列表添加物品
        BuyPage.Append(ISD[i].ICUF_Name + "  (" + ISD[i].ICUF_Float + ")", BuyPage.Times);
    BuyPage.Times++;
    BuyPage.RecoverTimes();
}

在执行一次程序后自动创建的SkinData_Local.txt文本文档中添加以下内容

1 地下水 1 0.2
2 地下水 2 0.3
3 地下水 3 0.4
4 地下水 4 0.5
5 地下水 5 0.6
6 地下水 6 0.7
7 地下水 7 0.8
8 地下水 8 0.9
9 地下水 9 1.0
10 地下水 10 1.1
11 地下水 11 1.2
12 地下水 12 0.4
13 地下水 13 0.2
14 地下水 14 0.3
15 地下水 15 0.4
16 地下水 16 0.2
17 地下水 17 0.3
18 地下水 18 0.4

打开购买商品页面即可看到本次主要的更新内容(如下图):
在这里插入图片描述


在这里插入图片描述
在此页面选择向上会得到如下效果

在这里插入图片描述


在这里插入图片描述
在此页面选择向下会得到如下效果

在这里插入图片描述
Wild_Chicken_Programing TANXL

这是第三版,增加了大量关于键盘缓冲区操作和输入、输出操作的知识讲解,并修改了多处前两版中文字、语句错误的地方。 前两个版本由于我等级不够无法删除,此处留下前两版的地址,希望对大家有用。 第一版:http://download.csdn.net/source/3056070 第二版:http://download.csdn.net/source/3332359 以下为第三版本的目录: C/C++控制台界面编程(V 3) 1 目录 - 1 - 第一部分 控制台界面编程预备知识 1 1) Visual Studio 2005中控制台程序的类型 1 2) 转义字符及格式化输入、输出 1 a) 制表符\t 2 b) 回退字符\b 4 c) ASCII码表 6 d) 以%开头的格式控制符 9 e) 数据流的格式设置 10 3) C和C++库的输入、输出操作 12 a) stdio.h中的常用输入、输出函数 13 b) basic_stream中的输入、输出操作 13 4) 键盘缓冲区处理 15 5) 关于C/C++中的字符串拼接问题 17 6) 怎样从控制台复制粘贴文字 18 7) 将批处理bat转换为exe程序 18 8) 在Visual Studio 2005中设置控制台程序的图标 18 9) 重定向控制台程序的输出 19 第二部分 控制台界面编程详解 20 1) 概述 20 2) 控制台文本窗口编程的一般控制步骤 21 3) 控制台窗口操作函数 21 4) 文本属性操作 25 5) 文本输出 28 6) 文本操作示例 28 7) 滚动和移动 34 8) 光标操作 36 9) 读取键盘信息 37 10) 读取鼠标信息 44 11) 结束语 46 第三部分 附录 1 1) 分数等级划分工具 1 a) controlio.h文件 1 b) Main.c文件 5 2) 简易俄罗斯方块 6 a) 代码Main.c文件 7 3) 模拟实现可用鼠标、键盘控制的菜单和窗口 11 这是第三版,增加了大量关于键盘缓冲区操作和输入、输出操作的知识讲解,并修改了多处前两版中文字、语句错误的地方。 前两个版本由于我等级不够无法删除,此处留下前两版的地址,希望对大家有用。 第一版:http://download.csdn.net/source/3056070 第二版:http://download.csdn.net/source/3332359
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

WiChP

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值