摘要: terminal中输入 vim ~/.bashrc 添加如下内容 #newlyadded export PATH="$PATH:/usr/local/sbin:/usr/sbin:/sbin" 打开新的terminal,输入 ifconfig 成功 如果不行,试试安装net-tools sudo a 阅读全文
posted @ 2020-05-12 19:01 profesor 阅读(484) 评论(0) 推荐(0) 编辑
摘要: 来源:https://blog.csdn.net/p309654858/article/details/131778994 进入 /etc/apt/路径cd /etc/apt/将sources.list备份保存为sources.backup.list,以防止有需要的时候更换回来cp -a sourc 阅读全文
posted @ 2020-05-12 07:57 profesor 阅读(2030) 评论(0) 推荐(0) 编辑
摘要: 1.备份源文件 cp /etc/apt/sources.list /etc/apt/sources.list_bk 2.手动修改源文件 vim /etc/apt/sources.list 3.选择其中一个源 #中科大 deb http://mirrors.ustc.edu.cn/kali kali- 阅读全文
posted @ 2020-05-12 07:55 profesor 阅读(803) 评论(0) 推荐(0) 编辑
摘要: 创建hello.java文件, 输入: public class hello { public static void main(String[] args) { System.out.println("hello, world!"); } } 在hello.java所在的directory中, 打 阅读全文
posted @ 2020-05-09 22:37 profesor 阅读(2251) 评论(0) 推荐(0) 编辑
摘要: 输出如下图形: * * * * * * * * * * * * * * * * * * * * * C语言代码 //打印倒三角图案 #include <stdio.h> void reversed_triangle(int n); //函数声明 int main() { int n; puts("需 阅读全文
posted @ 2020-05-08 16:54 profesor 阅读(1705) 评论(0) 推荐(1) 编辑
摘要: 要求:输入一个正整数n, 再输入n个整数,将它们按从小到大的顺序输出 // 输入指定的整数,然后把整数按从小到大的顺序每5个一行输出 #include <stdio.h> void order(int *a, int len); //函数声明 int main() { int n; printf(" 阅读全文
posted @ 2020-05-07 23:19 profesor 阅读(407) 评论(0) 推荐(0) 编辑
摘要: int 变量的默认初始值为0 这可以写个小程序测试下: #include <stdio.h> int main() { int i; if (i == 0) { printf("Hola, mundo, i = %d\n", i); } return 0; } 运行结果为: Hola, mundo, 阅读全文
posted @ 2020-05-05 12:13 profesor 阅读(5686) 评论(0) 推荐(0) 编辑
摘要: random module三个常用function: randint, choice, shuffle import random print(random.randint(1,10)) #从1到10(两头都包含)中随机选择一个数 words = ['grable', 'craven', 'mave 阅读全文
posted @ 2020-05-04 20:59 profesor 阅读(206) 评论(0) 推荐(0) 编辑
摘要: 输入一个正整数n(1<=n<=6),根据下式生成n阶方阵,将该方阵转置(行列互换)后输出。 a[i][j] = i*n+j+1 #include <stdio.h> int main() { int n; printf("输入方阵维数: \n"); scanf("%d", &n); int a[n] 阅读全文
posted @ 2020-05-04 17:36 profesor 阅读(222) 评论(0) 推荐(0) 编辑
摘要: 要求: 输入2个正整数m和n(1<=m<=6, 1<=n<=6),然后输入矩阵a(m行n列)中的元素,分别求出各行元素之和,并输出。试编写相应程序 #include <stdio.h> int main() { int m, n; // m,n作为行、列数 scanf("%d", &m); scan 阅读全文
posted @ 2020-05-04 16:39 profesor 阅读(339) 评论(0) 推荐(0) 编辑