c++网址大全

最近闲着没事做了个网址大全 其实灵感也是从别人借鉴来的

看到这篇文章就点一下下面,让我知道有多少人看到过这篇文章

具体功能:

1.能实现输入一个网址,打开这个网址

就是这样一个简陋的开始页面

输入网址:

 

网址导航栏

下面小调查自己看吧

代码 devc++和VS都可以运行

#include<windows.h>
#include<iostream>
#include<conio.h>
#include<string>
using namespace std;
void out(string o)
{
	for(int i=0;i<o.size();i++)//输出 
	{
		cout<<o[i];
		Sleep(80);
	}
}
string str(string n)
{
	n = "start " + n;//打开的网址 因为用system打开 所以要拼接 
	return n;
}
void pos(long long x, long long y, string str)
{
	for (long long i = 1; i <= x; i++)
		cout<<endl;//在第几行输出 是第几列就输出多少个endl 
	for (long long i = 1; i <= y; i++)
		cout<<" ";//在第几列输出 是第几列就输出多少个空格 
	cout << str;
	return;
}

void move(int x, int y)
{
	COORD pos = { x,y };
	HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);// 获取标准输出设备句柄
	SetConsoleCursorPosition(hOut, pos);//两个参数分别是指定哪个窗体,具体位置
}
int main()
{
	system("color F0");//颜色 
	start:
		for(int i=0;i<8;i++)cout<<endl;//行 
		cout<<"                                    ";//列
		out("按1输入网址");
		cout<<endl<<endl;
		cout<<"                                    ";
		out("按2网址导航栏");
		cout<<endl<<endl;
		cout<<"                                    ";
		out("按3小调查");
		cout<<endl<<endl;
		cout<<"                                            ";
		out("made with YR_T");
		int ch=_getch();
		while(ch!='1'&&ch!='2'&&ch!='3')ch=_getch();
		if (ch=='1')
		{
			system("cls");
			for(int i=0;i<8;i++)cout<<endl;//行 
			cout<<"                                    ";//列 
			out("网址打开");
			pos(1,15,"-----------------------------------------------------");
			pos(1,15,"|输入网址:                                           |");
			pos(1,15,"-----------------------------------------------------");
			move(25,10);//移动光标到输入网址后面 
			string url;
			cin>>url;
			url = str(url);//网址前面加上start 
			system(&url[0]);//打开 
			system("cls");
			goto start;//虽然乱但好用 
		}
		if (ch=='2')
		{
			system("cls");//清屏 
			for(int i=0;i<11;i++)cout<<endl;//行
			for(int i=0;i<20;i++)cout<<" ";//列
			cout<<"输入1.百度"<<endl;//  https://www.baidu.com
			for(int i=0;i<20;i++)cout<<" ";//列
			cout<<"    2.github"<<endl;//  https://github.com
			for(int i=0;i<20;i++)cout<<" ";//列
			cout<<"    3.CSDN"<<endl;//  https://csdn.net
			for(int i=0;i<20;i++)cout<<" ";//列
			cout<<"    4.vrcworld"<<endl; // http://www.vrcworld.com/
			for(int i=0;i<20;i++)cout<<" ";//列
			cout<<"    5.爱奇艺"<<endl;//  https://www.iqiyi.com/
			for(int i=0;i<20;i++)cout<<" ";//列
			cout<<"    6.优酷"<<endl;//  https://www.youku.com/
			for(int i=0;i<20;i++)cout<<" ";//列
			cout<<"    7.bilibili"<<endl;//  https://www.bilibili.com/
			for(int i=0;i<20;i++)cout<<" ";//列
			cout<<"    8.洛谷"<<endl;//  https://www.luogu.com.cn/
			for(int i=0;i<20;i++)cout<<" ";//列
			cout<<"    9.unity资源商店"<<endl;//  https://assetstore.unity.com/
			for(int i=0;i<20;i++)cout<<" ";//列
			cout<<"    10.unity官网"<<endl;//  https://unity.cn/
			for(int i=0;i<20;i++)cout<<" ";//列
			cout<<"    11.Pycharm官网"<<endl;//  https://www.jetbrains.com/pycharm/
			for(int i=0;i<20;i++)cout<<" ";//列
			cout<<"    12.阿里云官网"<<endl;
			for(int i=0;i<20;i++)cout<<" ";//列
			cout<<"    13.淘宝官网"<<endl;
			for(int i=0;i<20;i++)cout<<" ";//列
			cout<<endl<<endl;
			cout<<"请输入:";
			int s;
			cin>>s;
			if (s==1) system("start https://www.baidu.com");//直接打开 
			if (s==2) system("start https://github.com");
			if (s==3) system("start https://csdn.net");
			if (s==4) system("start http://www.vrcworld.com/");
			if (s==5) system("start https://www.iqiyi.com/");
			if (s==6) system("start https://www.youku.com/");
			if (s==7) system("start https://www.bilibili.com/");
			if (s==8) system("start https://www.luogu.com.cn/");
			if (s==9) system("start https://assetstore.unity.com/");
			if (s==10) system("start https://unity.cn/");
			if (s==11) system("start https://www.jetbrains.com/pycharm/");
			if (s==12) system("start https://www.aliyun.com/");
			if (s==13) system("start https://www.taobao.com/"); 
			system("cls");
			goto start;
		}
		if (ch=='3')
		{
			system("cls");
			for(int i=0;i<8;i++)cout<<endl;//行
			for(int i=0;i<25;i++)cout<<" ";
			cout<<"1.请问这个程序实用吗?A.很实用 B.还行 C.不实用 D.这作者这是做的什么玩意";
			cout<<endl<<"请输入:";
			char p[64],ch;
			int i=0;
			while (true)
			{
				ch=getch();//无回显的输入
				p[i++] = ch;
				if (ch=='\r'||ch=='\b')//getch()函数如果读到回车符号返回'/r'
				{
					p[i] = '\0';
					break;
				}
				putchar('A');
			}
			cout<<endl<<"感谢您的鼓励!";
			Sleep(1000);
			out("给你讲个故事");
			cout<<endl;
			out("有一天,你把 main.cpp里代码全部删掉,把我的代码复制进去------------------------------------");
			out("<<气岸头明>>");
			cout<<endl;
			out("呵呵呵...");
			Sleep(1000);
			system("cls");
			goto start;
		}
		return 0;
} 

 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值