- 博客(10)
- 收藏
- 关注
原创 2020-10-23
ubuntu换国内源换国内源可以解决网速慢的问题1.登录root用户su提示su命令没有 就用sudo passwd root设置一个2.先备份原来的源列表文件mv /etc/apt/sources.list /etc/apt/sourses.list.backup3.查看自己的版本lsb_release -c将返回的codename替换下面阿里云链接中的bionic,比如我的是focal4.新建源列表文件vim /etc/apt/sources.list加入源地址(推荐用阿里云源)
2020-10-23 16:19:50 112
原创 用c++实现斐波拉契数列的两种方式
用c/c++实现斐波拉契数列的两种方式非递归方式#include<iostream>using namespace std;int main() { int sign(int n); int n; cout << "请输入:" << endl; cin >> n; cout << "为:" << fun(n); return 0;}int fun(int n) { int i = 1, j = 1, k = 0
2020-09-09 21:52:30 346
原创 c++ const 的使用
c++ const 的使用1.修饰普通类型变量:不能改变值const int a=3;a=5 //错误,不能改变值2,修饰指针A·const在*前面const int *p=3;现在3所在的这个地址的值3不能变,但是p指针可以改变指向的地址B·const在*后面int *const p=3指针p指向的地址不能变,但是这个地址的值可以变C·const在*前面和后面,那就什么都不能变可以理解const在前面修饰int值,在后面修饰p指针...
2020-08-05 23:01:41 117
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人