C++模拟Windows系统(第4集)

Hello,我是老六工作室,今天我们继续来编辑我们的C++ Windows。

我们来看一下之前的代码:

#define n1 532
#define D 250
#include<iostream>
#include<windows.h>
using namespace std;
void sound()
{
    Beep(n1,D);
}
int setting()
{
    cout<<"设置 Setting"<<endl;
    cout<<"1:停止运行Windows C++"<<endl;
    cout<<"2:参数"<<endl;
    cout<<"3:关闭设置"<<endl;
    int a;
    cin>>a;
    switch (a)
    {
        case 1:
            {
                cout<<"停止Windows C++运行中...";
                _sleep(1000);
                return 0;
            }
        case 2:cout<<"【老六工作室】制作"<<endl;
    }
    return 0;
}
int main()
{
    system("title Windows C++");
    cout<<"Opening";
    cout<<".";
    _sleep(100);
    cout<<".";
    _sleep(100);
    cout<<".";
    _sleep(100);
    string username;
    cout<<endl;
    cout<<"欢迎使用~"<<endl;
    cout<<"[初始化1/2]请输入用户名:";
    cin>>username;
    string password;
    cout<<"[初始化2/2]请输入密码:";
    cin>>password;
    int len=password.length();
    while(len<6){
    cout<<"请重新输入(6位以上):";
    cin>>password;
    len=password.length();
    }
    return 0;
}

下面我们来编辑使用手册。

void user_handbook()
{
    cout<<"O键打开,W键关闭,C键复制,V键粘贴,U键向上,D键向下。"<<endl;
    _sleep(2000);
}

很短吧?

继续继续,来一个浏览器:

system("start https://baidu.com");

因为它太短,所以暂且把它放在一边(最后程序):

#define n1 532
#define D 250
#include<iostream>
#include<windows.h>
using namespace std;
void sound()
{
    Beep(n1,D);
}
int setting()
{
    cout<<"设置 Setting"<<endl;
    cout<<"1:停止运行Windows C++"<<endl;
    cout<<"2:参数"<<endl;
    cout<<"3:关闭设置"<<endl;
    int a;
    cin>>a;
    switch (a)
    {
        case 1:
            {
                cout<<"停止Windows C++运行中...";
                _sleep(1000);
                return 0;
            }
        case 2:cout<<"【老六工作室】制作"<<endl;
    }
    return 0;
}
void user_handbook()
{
    cout<<"O键打开,W键关闭,C键复制,V键粘贴。"<<endl;
    _sleep(2000);
}
int main()
{
    system("title Windows C++");
    cout<<"Opening";
    cout<<".";
    _sleep(100);
    cout<<".";
    _sleep(100);
    cout<<".";
    _sleep(100);
    string username;
    cout<<endl;
    cout<<"欢迎使用~"<<endl;
    cout<<"[初始化1/2]请输入用户名:";
    cin>>username;
    string password;
    cout<<"[初始化2/2]请输入密码:";
    cin>>password;
    int len=password.length();
    while(len<6){
    cout<<"请重新输入(6位以上):";
    cin>>password;
    len=password.length();
    }
    //system("start https://baidu.com");   浏览器
    return 0;
}

好了,今天就编辑到这里,我们C++模拟Windows系统(第5集)再见~

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值