结构体
结构体的定义和使用123456789101112131415161718192021222324252627282930313233#include<iostream>using namespace std;#include<string>//语法struct 类型名称{成员列表}struct Student{ //成员列表 string name; //姓名 int age; //分数 int score; };//2、通过学生类型创建具体学生//2.1 struct Student s1//2.2 struct Student s2={....}//2.3 在定义结构体时顺便创建结构体变量int main(){ //2.1 struct Student s1 struct Student s1; //给s1属性赋值,通过.访问结构体变量中的属性 s1.name="张三"; s1.age=18; ...
指针
指针的定义和使用
指针所占内存和空指针123456789101112131415161718192021222324#include<iostream>using namespace std;int main(){ int a = 10; //方式一 //int*p; //p = &a; //方式二 int*p = &a; //指针所占内存空间 //在32位操作系统下,指针大小都是4个字节,不论什么类型,64位则是8个字节 cout << "sizeof(int*)= " << sizeof(p)/*或者sizeof(int*)*/ << endl; cout << "sizeof(double*)= " << sizeof(double*) << endl; cout << "sizeof(char*)= " << sizeof(char*) << endl; cout < ...
函数
函数语法
函数的调用123456789101112131415161718192021222324252627#include<iostream>using namespace std;//num1和num2没有实际值,是形参int add(int num1, int num2){ int sum = 0; sum = num1 + num2; return sum;}int main(){ //main函数中调用add函数 int a = 10; int b = 20; //函数调用语法 函数名(参数) /*a,b为实际参数,简称实参 当调用函数的时候,实参的值会传递给形参*/ int c = add(a, b); cout << "c=" << c<<endl; //改变a,b的值 a = 100; b = 350; c = add(a, b); cout << "c=" << c << endl; system(&qu ...
跳转&数组
break语句123456789101112131415161718192021222324252627282930313233#include<iostream>using namespace std;int main(){ //1.出现在swich语句中 cout << "请选择副本难度" << endl; cout << "1.普通难度" << endl; cout << "2.中等难度" << endl; cout << "3.困难难度" << endl; system("pause"); int select = 0;//创建选择变量的结果 cin >> select;//等待用户输入 switch (select) { case 1: cout << "您选择的是简单难度" << endl; ...
嵌套学习
利用嵌套打印十行 *123456789101112131415161718#include<iostream>using namespace std;int main() { //利用嵌套打印十行* for (int j = 0; j <= 5; j++) { for (int i = 0; i <= 10; i++) { cout << "*"; } cout << endl; } return 0;}
利用嵌套打印乘法口诀表首先打印行123456789101112#include<iostream>using namespace std;int main(){ for (int i = 1; i <= 9; i++) { cout << "i" << endl; } system("pause"); return 0;& ...
小工具/杂项合集
清华大学开源软件镜像下载:https://mirrors.tuna.tsinghua.edu.cn/
视频压缩https://compress-video-online.com/zh
vscode下载镜像
https://code.visualstudio.com/ 官网链接
vscode.cdn.azure.cn
镜像链接
压缩引擎
图片压缩在线压缩图像文件,并确保最佳质量和压缩程度。 (iloveimg.com)
ubuntu-firefox有网但是打不开网页的解决办法1.检查ubuntu右上角联网开关是否打开,需要勾选Rnable Networking2.如果能ping通其他主机地址,浏览器却连不上网,很有可能是DNS域名解析的问题解决办法如下:
查看域名配置文件:cat /etc/resolv.conf12.输入sudo gedit /etc/resolv.conf将nameserver x.x.x.x部分改成nameserver 8.8.8.8保存3.输入sudo gedit /etc/resolvconf/reolv.conf.d/head添加nameserver 8 ...
Hello World
Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.
Quick StartCreate a new post1$ hexo new "My New Post"
More info: Writing
Run server1$ hexo server
More info: Server
Generate static files1$ hexo generate
More info: Generating
Deploy to remote sites1$ hexo deploy
More info: Deployment








